I\'m trying to create a table from tabular data in javascript, but when I try inserting rows into a table element, it inserts in the opposite
The .insertRow and .insertCell methods take an index. In absence of the index, the default value is -1 in most browsers, however some browsers may use 0 or may throw an error, so it's best to provide this explicitly.
To to an append instead, just provide -1, and an append will be done
var row = table.insertRow(-1);
var cell = row.insertCell(-1);
https://developer.mozilla.org/en-US/docs/DOM/table.insertRow