I'll post the two solutions I have tried, and what failed with each one:
First:
var table = document.createElement("table");
table.addClass("nice");
// fails because table does not have the "addClass" method
Second:
var table = $(document.createElement("table"));
table.addClass("nice");
var row = table.insertRow(-1);
// fails because table does not have the "insertRow" method (it has been cleared by jQuery)
How can I properly create a table and add rows and cells to it using jQuery?