简体   繁体   English

jqgrid:多行标题

[英]jqgrid: Multi-line headings

I have a jqgrid table with must contain some lengthy strings in the header cells. 我有一个jqgrid表,必须在标题单元格中包含一些冗长的字符串。 What is the proper way to format them? 格式化它们的正确方法是什么?

Just using the standard long string does not work since it will be cut at the right border of the cell if the cell width is too small. 仅使用标准的长字符串不起作用,因为如果单元格宽度太小,它将在单元格的右边界处被剪切。

Using a BR tag inside the text also does not work since the text after the BR tag is not being displayed (even after changing the height of the cell header through CSS). 在文本内部使用BR标签也不起作用,因为不会显示BR标签之后的文本(即使在通过CSS更改了单元格标题的高度之后)。

Any proper way to accomplish this? 有什么适当的方法可以做到这一点吗?

I would recommend you to use headertitles: true option to display tooltips with the full header text. 我建议您使用headertitles:true选项以显示带有完整标题文本的工具提示。

Moreover depend on your requirements you can consider to use wrapping of the column headers described in details here . 此外,根据您的要求,您可以考虑使用此处详细介绍的列标题的换行 One more alternative is to rotate column headers. 另一种选择是旋转列标题。 I personally frequently use the way in case of having column with short contain the cells (like checkboxs) and long text in the column headers (see here ). 我个人经常使用这种方式,以使具有短的列的列标题中包含单元格(如复选框)和长文本(请参阅此处 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM