H5代码如下
<div class="choise_content">
<table id="express"></table>
</div>
CSS代码如下
.choise_content{
width: 800px;
height: 200px;
margin: 0 auto;
margin-top: 30px;
border-bottom: 1px solid #D4D4D4;
padding-bottom: 15px;
}
JS代码如下
function expressList(){
$('#express').datagrid({
// url : urlNew
// rownumbers : true,//行号
// pagination : true,//分页空间
pageSize : 1,
pageNumber : 1,
fitColumns : true,
fixed: true,
fit : true,
nowrap: true,
singleSelect : true,
striped : true,
// toolbar: ,
columns : [[
{field : 'ltd',title : '22',width : '15%',align : 'center'},
{field : 'p',title : '33',width : '30%',align : 'center'},
{field : 'sever',title : '44',width : '35%',align : 'center'},
{field : 'time',title : '66',width : '15%',align : 'center'},
]]
});
};
在谷歌浏览器的控制台上显示的问题是
类名为class="datagrid-header-inner 的宽度10000px
求解 怎么解决
不用CSS解决能行不?
表格自适应宽度,建议每一行设置 width="xx%"
横向滚动条吧,在父容器里面设置overflow:scroll;