开发者

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?


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


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


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 :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜