<style>
.light-table-filter {
background: white;
border: 1px double #DDD;
border-radius: 5px;
box-shadow: 0 0 5px #333;
color: #666;
outline: none;
height:25px;
width: 400px;
}
</style>
<script>
(function(document) {
'use strict';
var LightTableFilter = (function(Arr) {
var _input;
function _onInputEvent(e) {
_input = e.target;
var tables = document.getElementsByClassName(_input.getAttribute('data-table'));
Arr.forEach.call(tables, function(table) {
Arr.forEach.call(table.tBodies, function(tbody) {
Arr.forEach.call(tbody.rows, _filter);
});
});
}
function _filter(row) {
var text = row.textContent.toLowerCase(), val = _input.value.toLowerCase();
row.style.display = text.indexOf(val) === -1 ? 'none' : 'table-row';
}
return {
init: function() {
var inputs = document.getElementsByClassName('light-table-filter');
Arr.forEach.call(inputs, function(input) {
input.oninput = _onInputEvent;
});
}
};
})(Array.prototype);
document.addEventListener('readystatechange', function() {
if (document.readyState === 'complete') {
LightTableFilter.init();
}
});
})(document);
</script>
<input type="search" class="light-table-filter" data-table="order-table" placeholder="Filter by typing match opponent, player name or score given">
<br />
<br />
<div style="width:99%">
<h2 class="subHeading">Player Ratings : Your Scores</h2>
<table class="order-table table" border="0" bordercolor="#a5cae4"width="100%" >
<thead>
<tr ALIGN="center" style = "background-color:#991010; font-size:8pt; color:#f0f0f0;">
<td >Game</td>
<td></td>
<td ALIGN="left" style = "padding-left:20px;">Name</td>
<td>Rating Given</td>
</tr>
</thead>
<xen:foreach loop="$rows4" value="$row" i="$i">
<xen:if is="{$row.user_id} == {$visitor.user_id} ">
<tbody>
<tr style="color:#646464;">
<td ALIGN="center" BGCOLOR="#f0f0f0" style = "font-size: 10pt; width:30%;">{$row.title}</td>
<td ALIGN="center" BGCOLOR="#f0f0f0" style="width:10%;"><img src="data:image/jpeg;base64,{$row.player_image}"/></td>
<td BGCOLOR="#f0f0f0"style = "padding-left:20px; font-size: 14pt;width:25%;">{$row.player_name}</td>
<td ALIGN="center" style = "font-size: 18pt; color:#991010; width:25%;"> <b>{$row.rating}</b></td>
</tr>
</tbody>
</xen:if>
</xen:foreach>
</table>
</div>