【发布时间】:2019-07-18 18:12:25
【问题描述】:
我想不出解决这个问题的方法。我尝试添加“table-layout:fixed”,但它不再适用于 dt 的当前版本。
谢谢
var config = {
"bFilter": false,
"bInfo": false,
"bPaginate": true,
"scrollY": 200,
"table-layout":fixed,
"data": dataoMine,
"bAutoWidth": false,
"columns": columns,
"scroller": true,
"language": {
"emptyTable": "empty data"
},
"columnDefs": [
{"className": "dt-center", "targets": "_all"}
]
};
<table class="dataTable" style="width:80%; height:100%; margin-left:10%; margin-right:10%;}">
<thead><tr>
<th>a1</th>
<th>a2</th>
<th>a3</th>
<th>a4</th>
<th>a5</th>
<th>a6</th>
<th>a7</th>
<th>a8</th>
</tr></thead>
</table>
【问题讨论】:
-
你能用小提琴重现这个吗?这是一个起点 -> jsfiddle.net/0f9Ljfjr/819
-
@davidkonrad 没什么特别的,只是将配置变量传递给 dt 的构造函数。就是这样
-
可以显示表格的html代码吗?
-
@Yuri 我已经更新了帖子以包含它,谢谢
-
@PrefijoSustantivo 数据源也不错,所以也许您可以发布一小部分源数组
标签: datatables