Thanks again! I am trying to add a header at the top, which would remain static, allowing the table to scroll under it. I can't seem to get it to work, and for some reason the header at the top is not the same width as the table below even though both are set to 250 for width...
Code:
<div>
<table style=border: none; border-collapse: collapse; border=0 cellspacing=0 cellpadding=0 align=center width=250>
<tr>
<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>Bank Name</FONT></th>
<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>City</FONT></th>
<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>Acq. Institution</FONT></th>
<th bgcolor=#222937><FONT COLOR=WHITE FACE=Geneva, Arial SIZE=3>Closing Date</FONT></th>
</tr>
</table>
</div>
<?php
$count = 1;
$input = 'https://www.fdic.gov/bank/individual/failed/banklist.csv';
echo "<style>
tr.row:nth-child(odd) {
background: blue;
}
tr.row:nth-child(even) {
background: black;
}
table.tBorder{
width:250; /* or what you need it to be */
height: auto; /* make this the size you want the data to be displayed in */
overflow: auto; /* this adds the scroll bars to the div when any data exceeds its hieght */
}
td.border{
width: 50%;
border-top: 1px solid #000000;
border-bottom: 0px solid #000000; /* move spacing to the cell */
}
</style>";
echo "<html><body><table class=tBorder style=border: none; border-collapse: collapse; border=0 cellspacing=0 cellpadding=0 align=center width=250>";
if (false !== ($ih = fopen($input, 'r')))
{
fgetcsv($ih);
while (false !== ($data = fgetcsv($ih)))
{
$outputData = array($data[0], $data[1], $data[4], $data[5]);
echo "<tr class=row >";
foreach ($outputData as $row)
{
echo "<td class=border align=center ><FONT COLOR=D3AB04 FACE=Geneva, Arial SIZE=2>" . htmlspecialchars($row) . "</FONT></td>";
$count++;
}
}
fclose($ih);
echo "</table></body></html>";
}
?>