How could I make a dynamic table when the number of rows (number of <tr> tags) and number of columns (number of <td> tags) are entered by the user?
I also need to make sure that each <td>tag has a unique id.
HTML:
I have a <div id=tabel> ... </div> in my html code where I need to insert this dynamic table.
Javascript:
var rows = content.rows, colums = content.columns, size = colums * rows, i;
$("tabel").append("<table>");
for (i = 0; i < size; i += 1) {
// make table with dynamic <tr> and <td>
}
Pseudocode or snippets of code would help me a lot!
for (;r < rows;) {create TR to TABLE; for (;c < columns;) {create TD to TR}}.