Hello,
I have a working script pulling data from mysql and into a table with alternate color rows using php.
As you can see I am able to adjust size to the table headers how ever I am at a lost in reducing the size to the row data.
This is a tricky one, any ideas?
$numofrows = @mysql_num_rows($result);
print '
<table width="650" border="0" cellpadding="0" cellspacing="0">
'; print '
<TR>
<td width="25%"> <font size="2">No.</font></td>
<td width="25%"><font size="2">Name</font></td>
<td width="50%"><font size="2">Last Name</font></td>
</TR>
'; for($i = 0; $i < $numofrows; $i++) { $row = @mysql_fetch_array($result);
if($i % 2) { print '
<TR bgcolor="#CCCCCC"> '; } else { print '
<TR bgcolor="#EAEAEA">'; } print "
<td>$i</td>
<td>" . $row['client_first_name']."</td>
<td>" . $row['client_last_name']."</td>
"; print "</TR>
"; } print "
</table>
";
?>