table header <hd>
Posted: Thu Jul 07, 2011 1:59 am
Dear all,
i have the following code to show a table header:
while ($get_row = mysql_fetch_assoc($get))
{
echo '<table border="1" cellpadding="2" cellspacing="2" width="200">
<tr>
<th>'.'Name'.'</th>
<th>'.'Phone No'.'</th>
</tr>
<tr>
<td width="50%">'. $get_row['name'].'</td>
<td width="50%" align="right"> '.$get_row['num'].'</td>
</tr>
</table>';
}
it repeats the heading on every row of the column:
Name Phone No
ahmed 34343433
Name Phone No
gul 3434343432
Name Phone No
shah 99228282
Name Phone No
nawaz 838372777
Name Phone No
waheed 4774474
Name Phone No
Wali 87222727
the heading should be only on first row.
what's the wrong?
Regards:
i have the following code to show a table header:
while ($get_row = mysql_fetch_assoc($get))
{
echo '<table border="1" cellpadding="2" cellspacing="2" width="200">
<tr>
<th>'.'Name'.'</th>
<th>'.'Phone No'.'</th>
</tr>
<tr>
<td width="50%">'. $get_row['name'].'</td>
<td width="50%" align="right"> '.$get_row['num'].'</td>
</tr>
</table>';
}
it repeats the heading on every row of the column:
Name Phone No
ahmed 34343433
Name Phone No
gul 3434343432
Name Phone No
shah 99228282
Name Phone No
nawaz 838372777
Name Phone No
waheed 4774474
Name Phone No
Wali 87222727
the heading should be only on first row.
what's the wrong?
Regards: