OK, I'm back again.
On one of my PHP pages, I build a table using the following code snippet:
[code=php]
<?php
echo "<table><THEAD> <tr>";
echo "<td><b>Inciden t</b></td>";
echo "<td><b>Facilit y</b></td>";
echo "<td><b>Locatio n</b></td>";
echo "<td><b>Per son</b></td>";
echo "<td><b>Inj ury</b></td>";
echo "<td><b>Severit y</b></td>";
echo "<td><b>Inciden t Date</b></td></tr></THEAD>";
while ($myrow = mysql_fetch_arr ay($result))
{
echo "<TBODY><tr><td >".$myrow["incident_i d"]."</td>";
echo "<td>  ".$myrow["fac_id"]."</td>";
echo "<td>  ".$myrow["room_descr "]."</td>";
echo "<td>  ".$myrow["person_typ e"]."</td>";
echo "<td>  ".$myrow["injury"]."</td>";
echo "<td>  ".$myrow["severity"]."</td>";
echo "<td>  ".$myrow["inc_date"]."</td>";
}
echo "</tr></TBODY></table>";
?>
[/code]
It works fine, but I am unable to add the other arguments to <table> such as border, class, etc.
I worked around this on one file by jumping out of php and coding the html <table> arguments and then jumping back into php to echo the data, but there must be a better way to do this.
Is there a way to enter the table arguments within php? I want something like
[code=html]
<table border name='Mytable class'='sortabl e'>
[/code]
Thanks,
jej1216
On one of my PHP pages, I build a table using the following code snippet:
[code=php]
<?php
echo "<table><THEAD> <tr>";
echo "<td><b>Inciden t</b></td>";
echo "<td><b>Facilit y</b></td>";
echo "<td><b>Locatio n</b></td>";
echo "<td><b>Per son</b></td>";
echo "<td><b>Inj ury</b></td>";
echo "<td><b>Severit y</b></td>";
echo "<td><b>Inciden t Date</b></td></tr></THEAD>";
while ($myrow = mysql_fetch_arr ay($result))
{
echo "<TBODY><tr><td >".$myrow["incident_i d"]."</td>";
echo "<td>  ".$myrow["fac_id"]."</td>";
echo "<td>  ".$myrow["room_descr "]."</td>";
echo "<td>  ".$myrow["person_typ e"]."</td>";
echo "<td>  ".$myrow["injury"]."</td>";
echo "<td>  ".$myrow["severity"]."</td>";
echo "<td>  ".$myrow["inc_date"]."</td>";
}
echo "</tr></TBODY></table>";
?>
[/code]
It works fine, but I am unable to add the other arguments to <table> such as border, class, etc.
I worked around this on one file by jumping out of php and coding the html <table> arguments and then jumping back into php to echo the data, but there must be a better way to do this.
Is there a way to enter the table arguments within php? I want something like
[code=html]
<table border name='Mytable class'='sortabl e'>
[/code]
Thanks,
jej1216
Comment