I have the following code that lists my database information as follows:
<?php //alphalist.php
Connect to database.......
for ($ascii=0; $ascii<26; $ascii++) {
$letter = chr($ascii+65);
$result = mysql_query("SELECT COUNT(id) FROM wanted WHERE surname LIKE '$letter%'");
$count = mysql_result($result,0);
if ($count>0) {
echo '<a href="category.php?cat=' . $letter . '">';
echo "$letter</a> (";
echo $count;
echo ' links)<br><br>';
} else {
echo '<a href="category.php?cat=' . $letter . '">';
echo "$letter</a> (0 links)<br><br>";
} }
?>
which gives me the links listed in a long column as below:
A (0 links)
B (0 links)
C (0 links)
D (5 links)
E (1 links)
F (2 links)
and on and on to z - to the bottom of the page!
Question? - How do I put this in a table across the page - in 3 columns
such as:
A (0 links) I (0 links) Q (0 links)
B (0 links) J (0 links) R (5 links)
C (1 links) K (2 links) S (1 links)
D (5 links) L (0 links) T (0 links)
E (0 links) M (0 links) U (0 links)
And on And on And on
Many thanks for your help