设置dataTables列内容居中
.table>tbody>tr>td{
text-align:center;
}
设置表头居中
.table>thead:first-child>tr:first-child>th{
text-align:center;
}
列内容过长实现隐藏并悬浮显示
{
"data": "operationInfo",
"render": function (data, type, row) {
if (data.length > 40) {
return "<a title='" + data + "' href='#' style='text-decoration: none;'>" + data.trim().substr(0, 40) + "..." + "</a>";
} else {
return data;
}
}
}