Create table parti-colored
When select the data in the database to create a table. A row, alternating colors to make
available information in the table more easily.
Example
<style>
.odd{background:#CCC;}
.even{background:#FFF;}
</style>
<table>
<?php
$bg = "odd";
for($i=0;$i<10;$i++)
{
echo "<tr class='$bg'>";
echo "<td> </td>";
echo "</tr>";
if($bg == "odd")
{
$bg = "even";
}
else
{
$bg = "odd";
}
}
?>
</table>
available information in the table more easily.
Example
<style>
.odd{background:#CCC;}
.even{background:#FFF;}
</style>
<table>
<?php
$bg = "odd";
for($i=0;$i<10;$i++)
{
echo "<tr class='$bg'>";
echo "<td> </td>";
echo "</tr>";
if($bg == "odd")
{
$bg = "even";
}
else
{
$bg = "odd";
}
}
?>
</table>
No comments:
Post a Comment