Skip to content

Commit

Permalink
moved header check after rows check
Browse files Browse the repository at this point in the history
  • Loading branch information
honzi committed Nov 14, 2024
1 parent 900daa6 commit fd476d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ function tables_sort(element, column, direction, type){
}

const rows = Array.from(tbody.children);
const header = rows[0].classList.contains('header');
const header_row = header ? rows.shift() : '';
if(rows.length === 0){
return;
}

const header = rows[0].classList.contains('header');
const header_row = header ? rows.shift() : '';

const column_content = [];
let main_column = 0;
for(const cssClass of table.classList){
Expand Down

0 comments on commit fd476d9

Please sign in to comment.