I have a table with resizing functionality. Actually, it is not a <table>
element. I use the cluster of <div>
elements.
Briefly, my resizing function is a nested 'for' loops. It is something like this:
function resizeTable (computedCellWidth) {
for (var r = 0; r < rows.length; r++) {
for (var c = 0; c < rows[r].cells.length; c++) {
rows[r].cells[c].domNode.style.width = computedCellWidth + 'px';
}
}
}
As I understand, each rows[r].cells[c].domNode.style.width = computedCellWidth + 'px';
causes the full document redraw. So, if a table is large enough, then table resizing extremely slows down the browser.
I tried to use throttling (100 ms) to reduce the amount of resize events, but if a table is large enough, then even a single resizing takes too much time.
Can I assign all width
properties first, and only after that launch the single redraw?