1.添加自定义的css文件,css内容如下
th.ui-th-column div{white-space:normal !important;height:auto !important;padding:0px;
}
2.html文件中添加对css文件的link
<!-- 添加自定义的css,允许jqgrid表头换行 --><link rel="stylesheet" type="text/css" th:href="@{/js/test/custome.css}">
3.jqgri添加换行符
{label: 'Test<br/>Path', name: 'testPath', width:100, sortable: false},
4.设置shrinkToFit: false,