我想 Zebra Stripe 结果表。我找不到可靠的解决方案。我需要对该表执行什么操作才能将奇数/偶数类添加到结果行?
// HTML ... Aliases from Mysql
echo "<table class='sortable' id='tablesorter' cellspacing='1' cellpadding='0' border='0' width='920px' >
<thead>
<tr>
<th class='header'>Short Name of Fund</th>
<th class='header'>I/C</th>
<th class='header'>Fund Manager Company</th>
<th class='header'>Class</th>
<th class='header'>Special Class</th>
<th class='header' id='custom'>TTR year-to-date<br /> %</th>
<th class='header'>Mgmt Fee Effectively Charged</th>
<th class='header id='custom'>Total Expenses <br /> %</th>
<th class='header'>Fund Size</th>
</thead><tbody>
</tr>";
//<tr> specifies table row. for each <td> (table data) will specify a new column. The $row specifies the mysql column name (in this case using an alias)
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><a href=\"page.php?id={$row['ID']}\">{$row['Short Name of Fund']}</a></td>";
echo "<td>" . $row['I/C'] . "</td>";
echo "<td>" . $row['Fund Manager Company'] . "</td>";
echo "<td>" . $row['Class'] . "</td>";
echo "<td>" . $row['Special Class'] . "</td>";
echo "<td>" . $row['TTR year-to-date %'] . "</td>";
echo "<td>" . $row['Mgmt Fee Effectively Charged'] . "</td>";
echo "<td>" . $row['Total Expenses %'] . "</td>";
echo "<td>" . $row['Fund Size'] . "</td>";
echo "</tr>";
}
echo "</tbody></table>";