Page 1 of 1
How to echo out 3 column table
Posted: Mon Feb 22, 2010 2:32 pm
by adsegzy
Hello friends, I need a help. I know now to echo out a 1 column table to display my search result. but i need to echo out my result in a table of about 3 columns to display my catelogue. please what is the syntax for it.
regards
Re: How to echo out 3 column table
Posted: Mon Feb 22, 2010 9:13 pm
by Benjamin
Code: Select all
<table cellspacing="0">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
<?php foreach ($result as $row): ?>
<tr>
<td><?php echo $row['1']; ?></td>
<td><?php echo $row['2']; ?></td>
<td><?php echo $row['3']; ?></td>
</tr>
<?php endforeach; ?>
</table>