We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 474648e commit 06f5c3aCopy full SHA for 06f5c3a
1 file changed
js/install.js
@@ -2,6 +2,22 @@
2
var options = INSTALL_OPTIONS;
3
4
Array.prototype.forEach.call(document.querySelectorAll('table'), function(table){
5
+ try {
6
+ // If there’s no tHead but the first tBody row contains ths, create a tHead and move that row into it.
7
+ if (!table.tHead && (var firstTBodyRow = table.tBodies[0].rows[0]).children[0].tagName === 'TH') {
8
+ var tHead = document.createElement('thead');
9
+ tHead.appendChild(firstTBodyRow);
10
+ table.insertBefore(tHead, table.firstChild);
11
+ }
12
+
13
+ // Sortable requires this
14
+ if (table.tHead.rows.length !== 1) {
15
+ return;
16
17
+ } catch (err) {
18
19
20
21
table.setAttribute('data-sortable', '');
22
table.classList.add('sortable-theme-' + options.theme);
23
});
0 commit comments