我怎样才能分配一个唯一的类 id,<tr>
即使我刷新时,id 也需要保持不变,因为我将使用它们来设置表格的样式。
这是我正在使用的代码:
while($row = mysql_fetch_array($result2))
{
echo "<tr id='centered' class='"; echo "'";
echo "<td>" . $row['Year_9'] . "</td>";
echo "<td>" . $row['Year_8'] . "</td>";
echo "<td>" . $row['Year_7'] . "</td>";
echo "<td>" . $row['Year_6'] . "</td>";
echo "<td>" . $row['Year_5'] . "</td>";
echo "<td>" . $row['Year_4'] . "</td>";
echo "<td>" . $row['Year_3'] . "</td>";
echo "<td>" . $row['Year_2'] . "</td>";
echo "<td>" . $row['Year_1'] . "</td>";
echo "<td>" . $row['Year_0'] . "</td>";