Posted by Ian B on 10/23/68 11:35
ZeldorBlat wrote:
> Try an HTML or CSS newsgroup.<html>
<head>
<title></title>
<style>
td
{
border : solid 1px blue;
}
..oddrow
{
background-color : #FFFFFF;
}
..evenrow
{
background-color : #CCCCCC;
}
#table1
{
border : solid 1px black;
}
</style>
</head>
<body>
<?php
$data = "Example of how to colour alternate lines";
$data .= "<table id='table1'>";
$colour = 0;
for($i=1;$i<26;$i++)
{
$colour = -$colour - 1;
$data .= ($colour)?'<tr class="oddrow">':'<tr class="evenrow">';
$data .= "<td> Line $i </td>";
$data .= "<td> Colour $colour </td>";
$data .= '</tr>';
}
$data .= "</table>";
echo $data;
?>
</body>
</html>
[Back to original message]
|