jqGrid supports header grouping. If you need just place multiline text in the column header you can implement this in more simple way.
The values in colNames
can be HTML fragments. So you should place the code which you need in the corresponding item of colNames
and add additional CSS which force to use auto
height of the column headers instead of fixed height used by jqGrid per default.
The demo place in the column header of the last column the HTML fragment
<div style="height: auto; padding: 4px 0;">
<span>Shipped</span><hr /><span>via</span>
</div>
and uses additionally the CSS
.ui-jqgrid .ui-jqgrid-labels .ui-th-column>div {height: auto}
As the result one get the grid as on the picture below