Using jQuery, how would you figure out how many columns are in a table?
-
2020-12-28 13:29
var foo = document.getElementById("price-test-table")
foo.tBodies["0"].firstElementChild.children.length
- Give your table an id name
- Assume your rows all have the same amount of columns and you have a table body
- Use above code, which I think is the simplest on here, similar to first answer
but provides a little more detail