I just to have ask any suggestions how to align the html table using PHP.
I have 2 records save in my TRAP table which are: chapter1 and chapter2...
this is my codes:
<table width="100">
<tbody>
<?php
$trapTable=mysql_query("SELECT * FROM trap WHERE subCode='$code' AND instructor='$user'");
while($trapResult=mysql_fetch_assoc($trapTable))
{ ?>
<th>
<?php
//echo'<tr><th>';
echo$trapResult['trapRecordName'];
//echo'</th></tr>';
?>
</th>
<?php
$recName=$trapResult['trapRecordName'];
$gradeSql=mysql_query("SELECT *FROM gradebook WHERE recordName='$recName' AND instructor='$user' AND subCode='$code'");
while($gradeResult=mysql_fetch_assoc($gradeSql))
{
echo'<tr>';
echo'<td>';
echo$gradeResult['studScore'];
echo'</td>';
echo'</tr>';
}
}
?>
</tbody>
</table>
In my codes above, It gives me a rigth output, but the problem is, all records are not align with the table, it goes like this:------------------------------
chapter1
12
3
15
chapter2
49
28
5
--------------------------------
What I want is something like this:
===============================
Chapter1-----------chapter2
12--------------------49
3---------------------28
5---------------------15
===============================
in table format, Please give me some suggestions,...GOD BLESS!!!


Sign In
Create Account

Back to top









