/*设置高度、滚动条*/
//其他DIV 高度
var tbheight =
document.getElementById("div_top").scrollHeight +
document.getElementById("div_tools_bar").scrollHeight+document.getElementById("div_tools_bar2").scrollHeight+document.getElementById("tbtop").scrollHeight;
//滚动条DIV高度-其他DIV 高度,超出显示滚动条
var divtb =
document.documentElement.clientHeight - tbheight - 30;
//不对齐解决办法,屏幕减去滚动条宽度
var winwidth = document.documentElement.clientWidth -
16;
var tbheight2 = "height:"+String(divtb) + "px;overflow:
auto; overflow-x:hidden; ";
var tbwidth2 =
"width:"+String(winwidth) + "px;";
//滚动条DIV
$("#divtblist").attr("style",tbheight2);
//表头tb
$("#tbtop").attr("style",tbwidth2);
$(".GridBar").attr("style",tbwidth2);
显示滚动条后,table 表头与内容不对齐,JS脚本控制,布布扣,bubuko.com
原文:http://www.cnblogs.com/lengv10/p/3726204.html