1、解决表格宽度的问题。
$(document).ready(
Function(){
$(“table”).css(“width”,”100%”);
});
2、解决表格使用colspan或者rowspan时表格宽度不安最多列数评分的问题。
$("table").css("table-layout","auto");
Table-layout用来显示表格单元格、行、列的算法规则
automatic 默认。列宽度由单元格内容设定。
fixed 列宽由表格宽度和列宽度设定。
inherit 规定应该从父元素继承 table-layout属性的值。
3、解决表格中内容不换行的问题
word-wrap : normal | break-word
参数:
normal : 允许内容顶开指定的容器边界
break-word : 内容将在边界内换行。如果需要,词内换行(word-break)也行发生
4、解决表格内的空白问题
$("th").css("white-space","normal")
white-space 属性设置如何处理元素内的空白