Below is my code which calls for a table to be created using php, it has very basic styling on it.
<?php
$result = mysql_query("SELECT * FROM League ORDER BY Points DESC, Difference DESC, TeamName DESC");
echo "<style>#size{height:100px;width:340px;overflow-y:scroll;}</style>";
echo "<table id='size' border='1'>;
<tr>
<th>Team</th>
<th>Played</th>
<th>Won</th>
<th>Drawn</th>
<th>Lost</th>
<th>For</th>
<th>Against</th>
<th>Difference</th>
<th>Bonus Pts</th>
<th>Points</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['TeamName'] . "</td>";
echo "<td>" . $row['Played'] . "</td>";
echo "<td>" . $row['W'] . "</td>";
echo "<td>" . $row['L'] . "</td>";
echo "<td>" . $row['D'] . "</td>";
echo "<td>" . $row['PF'] . "</td>";
echo "<td>" . $row['PA'] . "</td>";
echo "<td>" . $row['Difference'] . "</td>";
echo "<td>" . $row['BonusPoints'] . "</td>";
echo "<td>" . $row['Points'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
I have also created a way to style it in my CSS file below is the code
#customers
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#customers td, #customers th
{
font-size:1em;
border:1px solid #98bf21;
padding:3px 7px 2px 7px;
}
#customers th
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#A7C942;
color:#ffffff;
}
I'm aware that my table is not using the customer id for the table, but when I did it wouldn't work. So I added the simple styling at the top to see if it works and it did. Any suggestions how i can get it to use the customers styling? thanks