,可以通过使用CSS样式来实现。具体步骤如下:
<link rel="stylesheet" href="adminlte.css">
<link rel="stylesheet" href="dataTables.css">
<table id="example" class="table table-bordered">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Text 1</td>
<td>Text 2</td>
<td>Text 3</td>
</tr>
<!-- more rows... -->
</tbody>
</table>
$(document).ready(function() {
$('#example').DataTable({
// dataTables options...
});
});
#example td {
text-align: center; /* 居中对齐 */
/* 或者使用其他对齐方式,如:
text-align: left; // 左对齐
text-align: right; // 右对齐
*/
}
这样,使用dataTables AdminLTE3模板时,表格中的文本将按照你定义的样式进行对齐。
关于dataTables和AdminLTE3模板的更多信息,你可以参考以下链接:
领取专属 10元无门槛券
手把手带您无忧上云