basictable
basictable copied to clipboard
Add thead > td support
Hi Jerry,
Great library.
With our CMS, it has a weird output for the tables as:
thead > tr > td
Do you think adding this line to your library would help make it more accessible?
if (this.options.header) {
let format = "";
if (table.querySelectorAll("thead tr th").length) {
format = "thead th";
//Added Support
} else if (table.querySelectorAll("thead tr td").length) {
format = "thead td";
} else if (table.querySelectorAll("tbody tr th").length) {
format = "tbody tr th";
} else if (table.querySelectorAll("th").length) {
format = "tr:first th";
} else {
format = "tr:first td";
}
Cheers,
Robert
Hey @iamrobert the last condition should have taken care of this. What structure is your CMS outputting? Here's a sample I quickly mocked up: https://jsfiddle.net/owL2brd8/