What is the difference between:
jQuery('tr').after('<tr><td rowspan="4">value</td></tr>')
and
calling this 4 times
jQuery('tr').after('<tr><td>value</td></tr>')
I am trying to change table from
row1 |_____|_______|_______|
row2 | |___tr__|_______|
row3 | | |_______|
row4 |_____|_______|_______|
col1 col2 col3
to this:
_______________________
row1 |_____|_______|_______|
row2 | |___tr__|_______|
row3 | | | |
row4 |_____|_______|_______|
col1 col2 col3
I want to hide row3 and row4, the create a tr that takes 2 rows.
Using jQuery, because I want to change it through a click, it’s part of a project
The reason why it does not work for me, is if i use rowspan= n , I need to append n rows at the end to make it work.
Calling
$('tr').after('<tr><td>value</td></tr>')initiates a new row for each cell when being called four times.If you wish to have one cell in one row take up the content of four rows, then you would use your first statement.