Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getTable($hstart, $hmax, $hstep, $vstart, $vmax, $vstep){
- //do the column header row
- $out = "<table><tbody><tr>";
- for($h=$hstart-$hstep;$h<=$hmax;$h+=$hstep)
- $out .= ($h==$hstart-$hstep) ? "<th></th>" : "<th>".$h."</th>";
- $out .= "</tr>";
- //do the rest
- for($i=$vstart;$i<=$vmax;$i+=$vstep){
- //throw in the row header
- $out .= "<tr><th>".$i."</th>";
- //do the math
- for($j=$hstart;$j<=$hmax;$j+=$hstep)
- $out .= "<td>".$i*$j."</td>";
- $out .= "</tr>";
- }
- $out .= "</tbody></table>";
- return $out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement