Newbie here, advice and assistance if you would be so kind.
Ok I am trying to display a products information in a 3 column results style Paginated, each colum 1 record and each record has 5 fields and is displayed as 4 rows in a table with the 4th row split into two columns (subtable).
The information will be kept in flatfile csv, and will nedd to be read into the above, so far I have this,
http://www.ocpdirect.co.uk/bike1/productsgrid.php
Using the following Code:- The problem is I have had to start the counters for the loops at 1, as if I start at 0 as normal it does not display as expected.
Code: Select all
<?php
echo "<table width='575px' align='center' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
for($count=1; $count<=10; $count=$count+1)
{
if($count % 3 == 0)
{
echo "<td align='center' style='background-color:cyan'>";
echo "<table width='100%' align='center' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<th style='background-color: yellow;' align='center'>";
echo "Record: " . $count . " field[0]";
echo "</th>";
echo "</tr>";
for($c=1; $c<=3; $c=$c+1)
{
if($c == 3)
{
echo "<tr>";
echo "<td style='background-color: #FFD9D9;' align='center'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='50%' align='center'>";
echo "R-" . $count;
echo ", F-" . $c;
echo "</td>";
echo "<td width='50%' align='center'>";
echo "R-" . $count;
echo ", F-";
echo $c+1;
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
}
else
{
echo "<tr>";
echo "<td style='background-color: #DFFFFF;' align='center'>";
echo "R-" . $count;
echo ", F-" . $c;
echo "</td>";
echo "</tr>";
}
}
echo "</table>";
echo "</td></tr><tr>";
}
else
{
echo "<td align='center' style='background-color:cyan'>";
echo "<table width='100%' align='center' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<th style='background-color: yellow;' align='center'>";
echo "Record: " . $count . " field[0]";
echo "</th>";
echo "</tr>";
for($c=1; $c<=3; $c=$c+1)
{
if($c == 3)
{
echo "<tr>";
echo "<td style='background-color: #FFD9D9;' align='center'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='50%' align='center'>";
echo "R-" . $count;
echo ", F-" . $c;
echo "</td>";
echo "<td width='50%' align='center'>";
echo "R-" . $count;
echo ", F-";
echo $c+1;
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";
}
else
{
echo "<tr>";
echo "<td style='background-color: #DFFFFF;' align='center'>";
echo "R-" . $count;
echo ", F-" . $c;
echo "</td>";
echo "</tr>";
}
}
echo "</table>";
echo "</td>";
}
}
echo "</table>";
?>Mnay thanks, and kind regards
Andy