【发布时间】:2016-06-10 01:14:01
【问题描述】:
这是一个有统计数据的足球联赛。现在统计数据就在那里。我们希望让玩家可以选择对每个统计数据进行排序,以查看每个部门中谁是最高的和最低的。我不知道如何让每个表排序(降序,升序)。我一直在努力解决这个问题,也许有人可以提供帮助。
<h2>Passing Leaders</h2>
<table class="style-std" id="passing-leaders-table">
<thead>
<tr>
<th>Player</th>
<th>#</th>
<th>Team</th>
<th>Com</th>
<th>Att</th>
<th>Yd</th>
<th>Td</th>
<th>Int</th>
<th>1p</th>
<th>2p</th>
<th>Dr</th>
<th>Df</th>
<th>Sk</th>
<th>QBR</th>
</tr>
</thead>
<tbody>
<? foreach ($stats['passing'] as $row) : ?>
<tr>
<td><?=$row['name'] ?></td>
<td><?=$row['number'] ?></td>
<td><?=$row['team'] ?></td>
<td><?=$row['completion'] ?></td>
<td><?=$row['attempt'] ?></td>
<td><?=$row['yard'] ?></td>
<td><?=$row['touchdown'] ?></td>
<td><?=$row['interception'] ?></td>
<td><?=$row['1pat'] ?></td>
<td><?=$row['2pat'] ?></td>
<td><?=$row['drop'] ?></td>
<td><?=$row['deflection'] ?></td>
<td><?=$row['sack'] ?></td>
<td><?=passer_rating($row) ?></td>
</tr>
<? endforeach ?>
</tbody>
【问题讨论】: