$num = 2; echo '<table border="1">'; for ($i = 1; $i <= 100; $i++) { $result = $num * $i; echo "<tr><td>{$num}x{$i}</td><td>$result</td></tr>"; } echo '</table>'; PHP: You mean like that?