Manthan
Manthan

Reputation: 111

Max columns in html table

what is the max. no of columns and rows in a html table? Are there any browser issues while viewing the table?

Upvotes: 2

Views: 6308

Answers (3)

ADJenks
ADJenks

Reputation: 3434

If it's worth asking then it's worth testing it out, pick a big number and see if you crash your browser:

var t = document.getElementById('t')
var n = document.getElementById('n')
function cols(){
  t.innerHTML = '<tr>'+'<td>x</td>'.repeat(n.value)+'</tr>'
}
function rows(){
  t.innerHTML = '<tr><td>x</td></tr>'.repeat(n.value)
}
<input id="n" placeholder="How many? / Wie viele?"/>
<button type="button" onclick="rows()">Make rows</button>
<button type="button" onclick="cols()">Make cols</button>
<table id="t">
</table>

Don't pick a big number unless you don't have any important stuff open.

Add your high score as a comment :)

Upvotes: 0

danjah
danjah

Reputation: 3059

Trawling the DOM with Javascript would adversely effect page performance, case depending.

Upvotes: 0

Chinmayee G
Chinmayee G

Reputation: 8117

No. There is no as such limit to rows & columns. But

  1. It will definitely add horizontal & vertical scroll to your page. Too much scrolling can make your page practically impossible to view.
  2. Also your page size will increase a lot causing performance issue.
  3. Use will loose interest in your page, due to too much contents & bad user experience

Upvotes: 2

Related Questions