|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm tring to format output from a mysql table in html table fromat. I'm using the statement below and am having trouble with formating specifically the table width, border width, etc. My code is:
$result = mysql_query("SELECT * FROM events order by Name ASC",$db); while ($myrow = mysql_fetch_array($result)) { printf("<table><tr><td width="25%"><a href="%s?id=%s">%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </a> n ", $PHP_SELF, $myrow["ID"], $myrow["Name"], $myrow["Address1"], $myrow["Address2"], $myrow["City"], $myrow["State"], $myrow["Phone1"]); printf("<td><a href="%s?id=%s&delete=yes">(DELETE)</a></td></tr></table>", $PHP_SELF, $myrow["ID"]); } -------------------------------------- In html it should be something like: <table border="1" width="100%"> <tr> <td width="25%"> </td> <td width="25%"> </td> <td width="25%"> </td> <td width="25%"> </td> </tr> </table> Could someone please help? Thanks in advance. Bob |
|
#2
|
|||
|
|||
|
firstly
<td width="25%"> should be <td width="25%"> You only need backslashes before rabbits ears and i think apostrophies. Also.. You dont need the quotes when u type $row["fieldname"]. $row[fieldname] should work fine. Basil |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Formating Html Tables in PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|