jQuery dynamically add images to table
问题 I need to add images to a given table. I have the following code: HTML: <div class="container" id="game"></div> Javascript function table() { var i, x, domRow, domCol, rows = $("#rows").val(), colums = $("#columns").val(), table = $('<table>'), cellId = 0; table.empty(); for(i = 0; i < rows; i++) { domRow = $('<tr/>'); for(x = 0; x < colums; x++) { domCol = $('<td/>',{ 'id': "cell-" + cellId++, 'class': "cell", 'text': 'cell', 'data-row': i, 'data-col': x }); domRow.append(domCol); } table