I have a table that uses some php to populate it, and I am having trouble adjust each individual column width (based on their headers)... Can someone tell me how to do that?
(i.e) Name column is 30px width, last name column is 50px width, comments is 100px width
<style> table {width:100%; border-collapse:collapse; border:3px solid red; font-size: 10px;}
td {font-size: 10px; border: 1px solid blue;border-collapse:collapse; text-align: left; width: 50px; padding-top: 1px; padding-left: 1px;}
th {background: #ffb300; text-align: left; padding-top: 1px; padding-left: 1px; font-size: 10px;}
tr:hover {color: red; font-size: 10px;}
.dark {background: #ffb300;}
.light {background: #ffb300;}
</style>
<body>
<?php
echo "<html><body><table style=''>";
$f = fopen("csv.csv", "r");
$trcount = 0;
while (($line = fgetcsv($f)) !== false) {
$trclass = '';
if ($trcount%2==0)
{ $trclass=' class="dark"'; }
echo "<tr".$trclass.">\n";
$tdcount = 1;
foreach ($line as $cell) {
$tdclass = '';
if ($tdcount%2==0)
{ $tdclass='class="light"'; }
echo "<td ".$tdclass."style='padding:.4em;'>" . htmlspecialchars($cell) . "</td>";
$tdcount++;
}
$trcount++;
}
fclose($f);
echo "</table></body></html>";
?>