Adding rowspan to a column with jquery
<p>I have a table generated by ajax. After the table is created, i'd like to add a rowspan to a specific column. I've used </p>

<pre><code>$('#col_input').attr('rowspan', '2');
</code></pre>

<p>but the result seems not right. Even if the rowspan is added the value of the column is combined like this. </p>

<pre><code>A   B     C
1         3
1   222   3
1         3
</code></pre>

<p>How can I change it like this.</p>

<pre><code>A   B     C
1         3
1   2     3
1         3
</code></pre>

<p>Here's my ajax success script that generate the table</p>

<pre><code>success: function(response)
{
    var tableData,t1,t2,t3;

    $.each(response, function(index, data) {

        t1  = "&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;";
        t2  = "&lt;td id='col_input'&gt;&lt;input type='text' id='val_a' value='2' /&gt;&lt;/td&gt;";
        t3  = "&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;";

        tableData += t1+t2+t3;
        $('#tbl_add tbody tr').remove();
        $('#tbl_add tbody').append(tableData);
    });

     $('#col_input').attr('rowspan', '2'); 
}
</code></pre>

<p>and my html if needed</p>

<pre><code>&lt;table id="tbl_add"&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;strong&gt;A&lt;/strong&gt;&lt;/td&gt;
            &lt;td&gt;&lt;strong&gt;B&lt;/strong&gt;&lt;/td&gt;
            &lt;td&gt;&lt;strong&gt;C&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
    &lt;/table&gt;
</code></pre>

<p>nb: the value of the rowspan is the number of data generated by ajax</p>

<p>Thank you for your help</p>