Hi,
is there any solution to change atoz.php to make it to look something like this:
A
------------------------------------------
ab ah am
ac ai an
ad aj ao
af ak ap
ag al aq
B
------------------------------------------
bb bh bm
bc bi bn
bd bj bo
bf bk bp
bg bl bq
----
and so on...
Thank U
Hi,
Sure - here is an alternative html/atoz.php with a layout as described above...
<div class='atoz'>
<?php
$columns = 3;
$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 "<hr />";
$currentLetter = $firstLetter;
print "<table width='100%'>";
print "<tr>";
}
print "<td valign='top' width='".$columnWidth."%'>";
print "<p><a href='".$item["href"]."'>".$item["name"]."</a></p>";
print "</td>";
$currentColumn++;
if ($currentColumn == $columns)
{
print "</tr>";
print "<tr>";
$currentColumn = 0;
}
}
if ($currentColumn) print "</tr>";
print "</table>";
?>
</div>
Cheers,
David.
--
PriceTapestry.com