每当我们执行任何类型的活动(如点击,滚动或调整大小)时,我们都会在应用程序中遇到表行颜色失真问题。 我们得到了一个解决方案,如下所示,
$(window).on('scroll resize', function(){
var table = $('#our-table').DataTable();
table.columns.adjust().draw();
});
我们正在使用数据表的属性,如resizeWidth,paginationType,response etc等。
但是,只要发生事件,就必须执行此操作。我们正在寻找更好的解决方案,以便每次事件发生时都不需要调整数据表。
以下CSS正在应用于表
table {
width: 100%;
}
.dataTables_wrapper table.dataTable {
margin: 0px 0px;
}
table.dataTable.no-footer {
border-bottom: 1px solid #111;
}
table.dataTable.no-footer {
border-bottom: 1px solid #111;
}
table {
background-color: transparent;
}
for table body
tbody {
display: table-row-group;
}
.dataTables_wrapper table, .dataTables_wrapper th, .dataTables_wrapper td {
border-collapse: collapse;
}
table.dataTable {
width: 100%;
margin: 0 auto;
clear: both;
}