I want to be able to retrieve a list of entries from my mysql database and have it output a 2 or 3 column formatted html table. As I have it now, it just creates a single html table with only one column. The problem is I have around 30 entries, and I think it would look nicer if I could have it automatically create a new column for example after about 10 entries.
As it is now
1
2
3
4
5
6
7
8
9
As I would like it:
1 5
2 6
3 7
4 8
Is this possible?
Thanks!
Im using this code now
this is in my functions.php
//###################### categoryarraytotablerows #######################
// categoryarray 2 html-table
function categoryarraytotablerows($array) {
global $hash;
include ("admin/config/html.php"); //dont want to make a big big global
while (list ($orderid, $category) = each ($array)) {
// row color
$tablealtcolor = tablealtcolor($tablealtcolor);
// depth string
$depthstring = "";
for ($i=0;$i<$category["depth"];$i++) {
$depthstring .= "ยป ";
}
// fill variables for templates
$id = $category["id"];
$categoryid = $category["id"];
$title = $category["title"];
$description = $category["description"];
$linkend = ':';
$linkstart = '';
if ($category["categoryonly"] == 0) {
$linkend = "</a>";
$linkstart = "<a href=\"entry.php?hash=$hash&categoryid=".$categoryid."\">";
}
eval("\$category_listdata = \"".templateget('category_listdata')."\";");
eval("\$output .= \"".templateget('category_listrows')."\";");
}
return $output;
}
listdata.html
<td><b>
<!--linkstart-->
$linkstart
<!--/linkstart-->
<font color="$tablelinkcolor" size="$fontsize" face="$fontface">
<!--depthstring-->
$depthstring
<!--/depthstring-->
<!--title-->
$title
<!--/title-->
</font>
<!--linkend-->
$linkend
<!--linkend-->
</b><br><font size="$fontsizesmall" color="$tabletextcolor" face="$fontface">
<!--description-->
$description
<!--/description-->
</font></td>
listrows.html
<tr bgcolor="$tablealtcolor">
<!--category_listdata-->
$category_listdata
<!--/category_listdata-->
<!--<td><font color="$tabletextcolor" size="$fontsizesmall" face="$fontface">
[<a href="category.php?hash=$hash&action=edit&id=$id">
<font color="$tablelinkcolor" size="$fontsizesmall" face="$fontface">Edit</font></a>]
[<a href="category.php?hash=$hash&action=delete&id=$id"><font color="$tablelinkcolor" size="$fontsizesmall" face="$fontface">Delete</font></a>]</font>
</td>-->
</tr>
and table.html
<table cellpadding=0 cellspacing=0 border=0 width="98%" bgcolor="$tablebordercolor">
<tr><td>
<!--table-->
$table
<!--/table-->
</td></tr>
</table>