Try something like this:
function xxx() {
// Get table element
let table = document.getElementById("mytable");
// Get table rows
let rows = table.rows;
let bool = false;
// Go over rows
for(i = 0; i < rows.length; i++) {
// Get cells of current row
const columns = rows[i].cells;
let count = 0;
// Go over current row's cells
for(j = 0; j < columns.length; j++) {
// Count a cell if it has a value
if(columns[j].children[0].value != "") {
count++;
}
}
bool = count <= 5;
}
console.log(bool);
}
The function prints true if all rows have no more than 5 values per line.