I am working on a very simple javascript solution which is useful when using overflow-x:auto
in tables, script to decrease rows height by increasing table width
No one Answered this question but i found the solution myself:
Both will work:
var i = 0,
j, row, table = document.getElementsByTagName('table')[0];
while (row = table.rows[i++]) {
j = 1000;
while (row.offsetHeight > 200 && j < 2500) {
j += 500;
table.style.width = j + 'px';
}
}
OR
for (var i = 0, row; row = document.getElementsByTagName('table')[0].rows[i]; i++) {
if (row.offsetHeight > 200) {
document.getElementsByTagName('table')[0].style.width = "1500px";
if (row.offsetHeight > 200) {
document.getElementsByTagName('table')[0].style.width = "2000px";
if (row.offsetHeight > 200) {
document.getElementsByTagName('table')[0].style.width = "2500px";
}
}
}
}