daza93
11-19-2011, 09:22 AM
I'm using the following code to display data from my database but how do i change the font size, type of the table cells?
//Retrive all the data from the table
$result = mysql_query("SELECT * FROM stats2") or die(mysql_error());
echo "<table border='1' cellspacing='0' width='593'>";
echo "<tr> <th bgcolor='#BFBFBF' align='center'>Name</th> <th bgcolor='#BFBFBF' align='center'>Apps(Sub)</th> <th bgcolor='#BFBFBF' align='center'>Goals/CS</th> <th bgcolor='#BFBFBF' align='center'>Yellows</th> <th bgcolor='#BFBFBF' align='center'>Reds</th> <th bgcolor='#BFBFBF' align='center'>MOTM</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td align='center'>";
echo $row['name'];
echo "</td><td align='center'>";
echo $row['apps']; echo '('; echo $row['sub']; echo ')';
echo "</td><td align='center'>";
echo $row['goals'];
echo "</td><td align='center'>";
echo $row['yellows']";
echo "</td><td align='center'>";
echo $row['reds'];
echo "</td><td align='center'>";
echo $row['MOTM'];
echo "</td></tr>";
}
echo "</table>";
//Retrive all the data from the table
$result = mysql_query("SELECT * FROM stats2") or die(mysql_error());
echo "<table border='1' cellspacing='0' width='593'>";
echo "<tr> <th bgcolor='#BFBFBF' align='center'>Name</th> <th bgcolor='#BFBFBF' align='center'>Apps(Sub)</th> <th bgcolor='#BFBFBF' align='center'>Goals/CS</th> <th bgcolor='#BFBFBF' align='center'>Yellows</th> <th bgcolor='#BFBFBF' align='center'>Reds</th> <th bgcolor='#BFBFBF' align='center'>MOTM</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td align='center'>";
echo $row['name'];
echo "</td><td align='center'>";
echo $row['apps']; echo '('; echo $row['sub']; echo ')';
echo "</td><td align='center'>";
echo $row['goals'];
echo "</td><td align='center'>";
echo $row['yellows']";
echo "</td><td align='center'>";
echo $row['reds'];
echo "</td><td align='center'>";
echo $row['MOTM'];
echo "</td></tr>";
}
echo "</table>";