pass a dynamically created table on submit
<p>I am building a simple application that will allow the users to add rows to a table and generate that table so the user can type in data into the rows and columns.</p>

<p>So far I have managed to create the rows dynamically <a href="http://jsfiddle.net/mgqsacgq/2/" rel="nofollow">jsfiddle</a></p>

<p>Now what I need to do is when the user hits <b>generate</b> (I am using PHP for this), the table must be shown in a html text area. </p>

<p>I did try the below code but didn't work</p>

<pre><code>&lt;form action="1.php" method="post"&gt;
&lt;?php
 echo $table = '&lt;table id="maintable" width="50%" cellpadding="0" cellspacing="0" class="pdzn_tbl1" border="#729111 1px solid" &gt;
&lt;tr&gt;&lt;td colspan=3&gt;sdsdsdsds&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=1&gt;fsdfsf&lt;/td&gt;&lt;td colspan=2&gt;sdffsdfsf&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;';?&gt;

&lt;textarea name="thetable" style="display:none"&gt;&lt;?php echo $table ?&gt;&lt;/textarea&gt;

&lt;input type="button" name="add" value="Add 1 Column" id="addrows1" style="color:#3300FF; font-size:16px; " /&gt;

&lt;input type="submit" name="gen" value="Generate Table"  style="color:#3300FF; font-size:16px; " /&gt;
&lt;/form&gt;

&lt;?php

if(isset($_POST['gen']))
{
var_dump($_POST['thetable']);   
}

?&gt;
</code></pre>

<p>Any help on how i can fix this?</p>