Neat Php Table Generator
| From: | Clint & Justin Cruse | Date: | Sat, 13 Oct 2001 00:37:37 +0000 |
| Subject: | Neat Php Table Generator | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-6994@lists.php.net to get a copy of this message | ||
This is a little easily customizable table generator that I wrote. I hope someone finds it useful.
<html>
Sin<br>
<?php
//config
$min=1;//start
$max=360;//end
$div=5;//columns
function func ($i)
{
return sin(deg2rad($i));//what to display with each value
}
echo '<table border="5">
<tr>
<td>';//tabel setup
//end config
$col=$max/$div;
for($j=1;$j<=$div;$j=$j+1){
for ($i=$col*($j-1)+1;$i<=$col*$j;$i=$i+1){
echo "$i<br>";
}
echo '</td><td>';
for ($i=$col*($j-1)+1;$i<=$col*$j;$i=$i+1){
$r=func($i);
echo "$r</br>";
}
if($j<$div){
echo '</td><td>';
} else {
echo '</td></tr></table>';
}
}
?>
</html>