At the moment I have 4 columns, the first row is the A to Z with the products on the second row, etc.
Is it possible to have the layout as follows?
A
product product product product
product product product product
product product product product
product product product
B
product product product product
product product product product
product product product product
product product product
Hi Jill,
Have a go with this version of html/atoz.php for that style of layout:
<div class='atoz'>
<?php
$columns = 4;
$columnWidth = intval(100/$columns);
$currentLetter = "";
$currentColumn = 0;
foreach($atoz["items"] as $item)
{
$firstLetter = strtoupper(substr($item["name"],0,1));
if ($firstLetter !== $currentLetter)
{
if ($currentLetter !== "")
{
print "</tr>";
print "</table>";
}
print "<h4>".$firstLetter."</h4>";
print "<table width='100%'>";
print "<tr>";
$currentLetter = $firstLetter;
}
$currentColumn++;
print "<td valign='top' width='".$columnWidth."%'>";
print "<a href='".$item["href"]."'>".$item["name"]."</a>";
print "</td>";
if ($currentColumn == $columns)
{
print "</tr>";
print "<tr>";
$currentColumn = 0;
}
}
print "</tr>";
print "</table>";
?>
</div>
Cheers,
David.