Skip to content

Commit

Permalink
Fix fallback query selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry Low committed Mar 8, 2023
1 parent f9feafd commit a52a829
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dist/js/basictable.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class basictable {
} else if (table.querySelectorAll("tbody tr th").length) {
format = "tbody tr th";
} else if (table.querySelectorAll("th").length) {
format = "tr:first th";
format = "tr:first-of-type th";
} else {
format = "tr:first td";
format = "tr:first-of-type td";
}
table.querySelectorAll(format).forEach((heading => {
const colspan = parseInt(heading.getAttribute("colspan"), 10) || 1;
Expand Down Expand Up @@ -178,4 +178,3 @@ class basictable {
}
}
}

2 changes: 1 addition & 1 deletion dist/js/basictable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/js/basictable.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class basictable { // eslint-disable-line no-unused-vars
} else if (table.querySelectorAll('tbody tr th').length) {
format = 'tbody tr th'
} else if (table.querySelectorAll('th').length) {
format = 'tr:first th'
format = 'tr:first-of-type th'
} else {
format = 'tr:first td'
format = 'tr:first-of-type td'
}

table.querySelectorAll(format).forEach(heading => {
Expand Down

0 comments on commit a52a829

Please sign in to comment.