[code]<?php

// TAFELS BY JONATHAN MO & WESSEL BRUINSMA
// ....

// ---CONFIG------
$begintafel = 1;
$tottafel = 10;

$beginsom = 1;
$totsom = 10;

$rij = 5;

$breedte = false;
$hoogte = false;
//----------------







//----------------
$extra = '';
if ($rij == false)
{
	$rij = 10;
}
if ($hoogte != false)
{
	$extra .= chr(10).'height: '.$hoogte.';';
}
if ($breedte != false)
{
	$extra .= chr(10).'width: '.$breedte.';';
}
if (($tottafel-($begintafel-1)) > ($rij-1))
{
	$span = $rij;
}
else
{
	$span = $tottafel-($begintafel-1);
}
echo '<style type="text/css">.tafels{padding: 2px;margin: 2px;border: 1px black solid;font-family: Arial;font-size: 10pt;background-color: #C0C0C0;'.$extra.'}.tafels tr td{padding: 5px;margin: 2px;border: 1px black solid;font-family: Arial;font-size: 10pt;background-color: white;}</style>';
$nu = $rij;
echo chr(10).'<table class="tafels"><tr><td colspan="'.$span.'"><b>De Tafels</b><br>Van de tafel '.$begintafel.' tot de tafel '.$tottafel.'.<br>Van de som '.$beginsom.' tot de som '.$totsom.'.';
for ($tafel = $begintafel; $tafel < ($tottafel + 1); $tafel++)
{
	if ($nu == $rij)
	{
		$add = false;
		echo '<tr>';
		$nu--;
	}
	else
	{
		if ($nu == 1)
		{
			$nu = $rij;
			$add = true;
		}
		else
		{	$add = false;
			$nu--;
		}
	}
	echo '<td>';
	for ($som = $beginsom; $som < ($totsom + 1); $som++)
	{
		if ($som != $beginsom)
		{
			echo '<br>'.chr(10);
		}

		$ant = $tafel * $som;

		echo $tafel.' X '.$som.' = '.$ant;
	}
	echo '</td>'.chr(10);
	if ($add)
	{
		echo '</tr>';
	}
	$last = $add;
}
if ($last == false)
{
	echo '</tr>';
}
echo chr(10).'<tr><td colspan="'.$span.'"><i>Script By Wessel Bruinsma & Jonathan Mo</i></td></tr>';
echo '</table>';
//----------------
?>[/code]


