问题
I have a jqgrid in the which i display some info..
My column name should appear in the same way as below
Canada Australia
Month / Year Month / Year
Tha is how i need to display my columns each column name should display Month/Year below it.
as of now my code looks like
colnames: [Id,Canada,Australia,Usa]
回答1:
It's depend on what you need exactly. The text from colNames
items is in general HTML fragment. So you can use <br/>
for example:
colNames: ["Id", "Canada<br/>Month / Year", "Australia<br/>Month / Year",
"Usa<br/>Month / Year"]
To have the height of the column headers increased you could include CSS like
.ui-jqgrid .ui-jqgrid-htable th div { height: auto }
after ui.jqgrid.css
.
Alternatively you could want that the text in column header will be wrapped. The case are discussed before in the answer.
来源:https://stackoverflow.com/questions/24597410/jqgrid-customize-column-name-display