在表头中使用换行符<br>
:
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>fees<br>covered</th>
<th>name<br>shown</th>
<th>amount<br>shown</th>
</tr>
</thead>
</table>
请查看这个JSFiddle链接,其中包含代码和演示。
columns
定义中使用title
键的适应版本。"title": "Your Title".split(" ").join("<br/>"), // Your<br/>Title
columns.width
设置每个列的宽度。还可以参考autoWidth
选项。 - Gyrocode.com