--- In [email protected], "Muthukumar Selvarasu"
<[EMAIL PROTECTED]> wrote:
>
> Please remember to write your response BELOW the previous text.
>
> From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf
> Of Joseph
> Sent: Wednesday, April 02, 2008 5:47 AM
> To: [email protected]
> Subject: [php-list] How Do You Increment Numbers in Steps
>
> Hi all
>
> I am trying create a table on the fly, to display unicode characters
> and I want that every thirty table cells to insert a table header cell
> so that when a user scrolls down the page they can always see a header
> every so often.
>
> Can anyone point me to a good mathematics tutorial for PHP please?
>
> Joseph
>
> ------------------------------------
>
> Hi
>
> I hope you using while / for loop to show the list of records.
>
> Add condition inside the loop
>
> While ....
> {
> $inc ++;
> If($inc % 30 ==0) echo "Your header row code";
> }
>
>
> Thanks,
> Muthukumar Selvarasu,
> Project Manager (Web Development),
> Webmasters Ltd.
>
Hi All
Thanks for your input which I have tried, but my nOObie brain can't
grasp the concept.
I have creratred this bit of code to do the job, but Like I said, the
maths totally escapes me and it is just coming out wrong.
Here is some of my code (3 versions out of the many many different
ways I have tried to make this work).
//===================================
Example 1
//===================================
<?php
// vars
$ystr1 = "\n<tr>\n<td width=\"35\" class=\"ybig\"> \n</td>\n<td
width=\"15\"><strong>";
$ystr2 = ";</strong>\n</td>\n";
$ystr3 = "<td width=\"15\">\n<strong>&#";
$ystr4 = "</td>\n<td width=\"35\"> \n</td>\n</tr>\n";
// max limit for our unicode characters
$ystart = 1;
// number of cells we want to skip before we print a header cell.
// keep printing squares until lower limit = upper limit
for ($headme = 30; $headme <= 300; $headme % 30)
{
while ($ystart <= 300)
{
echo $ystr1.'&#'.$ystart.$ystr2;
echo $ystr3.$ystart.$ystr4;
$ystart++;
if ($headme %30 ==0)
echo "<tr><th colspan=\"2\">Character
(".$headme.")</th><th
colspan=\"2\">Unicode</th></tr>";
$headme += 30;
}
}
echo "</table></center>";
// print end marker
?>
//===================================
Example 2
//===================================
<?php
// vars
$ystr1 = "\n<tr>\n<td width=\"35\" class=\"ybig\"> \n</td>\n<td
width=\"15\"><strong>";
$ystr2 = ";</strong>\n</td>\n";
$ystr3 = "<td width=\"15\">\n<strong>&#";
$ystr4 = "</td>\n<td width=\"35\"> \n</td>\n</tr>\n";
// set variables for our maths
//-----------------------------------------------------------------------------
// max limit for our unicode characters
$ystart = 1;
$headme = 31;
// number of cells we want to skip before we print a header cell.
// keep printing squares until lower limit = upper limit
while ($ystart <= 3000)
{
echo $ystr1.'&#'.$ystart.$ystr2;
echo $ystr3.$ystart.$ystr4;
for ($headme = 20; $headme<=100; $headme %20)
{
echo "<tr><th colspan=\"2\">Character (".$headme.")</th><th
colspan=\"2\">Unicode</th></tr>";
}
$headme = $ystart + 20;
$ystart = $ystart;
$ystart++;
}
echo "</table></center>";
// print end marker
?>
//===================================
Example 2
//===================================
<?php
// vars
$ystr1 = "\n<tr>\n<td width=\"35\" class=\"ybig\"> \n</td>\n<td
width=\"15\"><strong>";
$ystr2 = ";</strong>\n</td>\n";
$ystr3 = "<td width=\"15\">\n<strong>&#";
$ystr4 = "</td>\n<td width=\"35\"> \n</td>\n</tr>\n";
// set variables for our maths
//-----------------------------------------------------------------------------
// max limit for our unicode characters
$ystart = 1;
$headme = 31;
// number of cells we want to skip before we print a header cell.
for ($headme = 20; $headme<=100; $headme +=20)
{
echo "<tr><th colspan=\"2\">Character (".$headme.")</th><th
colspan=\"2\">Unicode</th></tr>";
}
$headme = $ystart + 20;
$ystart = $ystart;
// keep printing squares until lower limit = upper limit
while ($ystart <= 3000)
{
echo $ystr1.'&#'.$ystart.$ystr2;
echo $ystr3.$ystart.$ystr4;
$ystart++;
}
echo "</table></center>";
// print end marker
?>
//===================================
They all work (sort of) but they simply print a table header row,
after each table cell row, which is not what I want.
Any Advice?