A
Anonymous
Guest
I am a newbie at PHP and I have created a form that takes input from a user and then throws that into a MySQL database, then have it print out into a table. However, when I print it out into this table its is not formated very well. For instance I have headings that are printing on 2 lines instead of 1, and data doing the same. I have included my code, its kinda messy, if anyone could help that would be greatly appreciated.
[Edited by Redcircle] Use code tags they are your friend. They won't bite.
Code:
echo "<table border=2 cellpadding=15 cellspacing=0 width=100%>\n";
echo "<tr><td>Project Number</td><td>Project Name</td><td>Prepared By</td><td>Importance</td><td>Question 1<td>Question 2</td><td>Question 3</td><td>Question 4</td><td>Date Needed</td><td>Estimated Cost</td><td>Date Requested</td><td>Assigned To</td><td>Date Assigned</td><td>Assigned By</td><td>Completed By</td><td>Date Completed</td></td></tr>\n";
while ($myrow = mysql_fetch_row($result))
{
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $myrow[0], $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6], $myrow[7], $myrow[8], $myrow[9], $myrow[10], $myrow[11], $myrow[12], $myrow[13], $myrow[14], $myrow[15]);
}
echo "</table>\n";
[Edited by Redcircle] Use code tags they are your friend. They won't bite.