I ve been working on this simple code that puts a CSV file into a nice table. But because the data is imported, styling ODD rows is a pretty hard thing to do.
All I need would be a method to address certain rows, so I can make a "zebra" like background, and put specific data in another text style.
Does aynone have an idea? thanks a lot!
<?php
print("<TABLE>
");
$row = 0;
$handle = fopen("test_file.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
for ($c=0; $c <= $row; $c++)
{
print("<TR>");
print("<TD>".$data[0]." </td>");
print("<TD>".$data[1]." </td>");
print("<TD>".$data[2]." </td>");
print("<TD>".$data[3]." </td>");
print("<TD>".$data[4]." </td>");
print("</TR>");
}
}
fclose($handle);
?>