【发布时间】:2013-12-30 15:20:10
【问题描述】:
如何显示空单元格的边框?有些列是空白的,没有值,所以这些列没有显示边框和它的空白。请看下面的屏幕截图并建议。
还有就是有两条边线,怎么做成一条边线?
HTML
<table border="1" id="products1" style="width:750px" >
<thead>
<tr>
<th>End Date</th>
<th>Modify Date</th>
<th>Comments</th>
<th>By Who</th>
</tr>
</thead>
<tbody></tbody>
</table>
JS
oTable = $("#products1").dataTable({
"aaData": newarray,
"bProcessing": true,
"bDeferRender": true,
"bFilter": true,
"bRetrieve": true,
"bPaginate": true,
"bJQueryUI": true,
"iDisplayLength": 5,
"sPaginationType": "two_button",
"sDom": 'T<"clear">frtip',
"aoColumns": [{"sWidth": "135px","sClass": "center","bSortable": true},{
"sWidth": "145px","sClass": "center","bSortable": true},{
"sWidth": "145px","sClass": "center","bSortable": true},{
"sWidth": "20px","sClass": "center","bSortable": false}
],
"aoColumnDefs": [{ "fnRender": function (o, val) {
return o.aData[0];
},
"sClass": "end date","aTargets": [0]
}, {
"fnRender": function (o, val) {
return o.aData[1];
},
"sClass": "modified date","aTargets": [1]
}, {
"fnRender": function (o, val) {
return o.aData[2];
},
"sClass": "comments","aTargets": [2]
},{
"fnRender": function (o, val) {
return o.aData[3];
},
"sClass": "By who","aTargets": [3]
}
]
});
【问题讨论】:
-
问题出在 不是吗?那么它的代码在哪里呢?看起来您在没有价值的情况下遗漏了
<td>。除非你这样调整 colspan 是无效的显示创建图像显示的 tbody 行 html
标签: jquery datatable jquery-datatables