I know I've been here before, but I need additional help. I somehow need the following table to have HTML code that will create a table with two columns and three rows. The top left column will have the title rows, the middle will have columns, the bottom will have a submit button so that when you add numbers to the right columns ie. put 10 in the row text box and 10 in the column text box and a 10 X 10 multiplication table will be created. I ave the following PHP and HTML codes, but they are not working together. Please Help!
I thought that I could get the HTML code to work in the PHP document.
<form name="table" id="table" action="table.php" method="post">
<h2>Table Generator</h2>
<p>
<label for="width">Rows:</label>
<input type="text" name="Width" id="Width" />
</p>
<p>
<label for="height">Columns:</label>
<input type="text" name="height" id="height" />
</p>
<input name="sbt" type="submit" formaction="table.php" onClick="MM_validateForm('Width','','RisNum','height','','RisNum');return document.MM_returnValue" value="Calculate" />
</form>
<?php
$rows = $_POST ['width'];
$columns = $_POST ['height'];
$width = 5;
$height = 6;
$i=1;
$table='<table border="1">';
for($r=0;$r<$width;$r++)
{
$table .= '<tr>';
for($c=0;$c<$height;$c++)
{
$table .= "<td>$i</td>";
$i++;
}
$table .= '<tr>';
}
$table .= '</table>';
echo $table;
?>
burt.munn 0 Light Poster
pzuurveen 90 Posting Whiz in Training
burt.munn 0 Light Poster
diafol
burt.munn 0 Light Poster
diafol
burt.munn 0 Light Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.