I have a function that dynamically creates tables:
function generateTableContent(data) {
var table = $('<table id="tblResultsList">');
var tr;
var td;
$.each(data.d.foundItems, function(i, item) {
var button = $('<button/>', {
text: item.code,
click: function () { CellClicked(item.x,item.y,"") }
});
i % 3 === 0 && (tr = $('<tr>').appendTo(table));
tr.append('<td>').prepend(button).end();
});
$('#rstSearch').append(table);
}
Here's the current view after implementing the function:
https://i.sstatic.net/AVX5o.png
View the actual content design here in this Fiddle.
And here is how I want the content to look:
https://i.sstatic.net/2MIri.png
Check out the desired design in this Fiddle.
However, I am currently facing a challenge. I need assistance with centering the content and making it square-shaped.