【发布时间】:2012-04-24 12:31:35
【问题描述】:
如何在不更改 css(全局)的情况下使网格的标题居中? 默认情况下,标题在左侧。
【问题讨论】:
标签: jqgrid
如何在不更改 css(全局)的情况下使网格的标题居中? 默认情况下,标题在左侧。
【问题讨论】:
标签: jqgrid
我认为标题居中的代码可能是以下内容
$("#grid").closest("div.ui-jqgrid-view")
.children("div.ui-jqgrid-titlebar")
.css("text-align", "center")
.children("span.ui-jqgrid-title")
.css("float", "none");
见the demo:
【讨论】:
caption 值作为 HTML 片段和另一个字体大小,如 caption: '<span style="font-size:20px">Demonstrate how to center the title of the grid</span>'
caption: "<span style="font-size:20px">Demonstrate how to center the title of the grid</span>" 的用法(更改网格标题的字体大小)结合起来
这个问题被提出和回答已经有一段时间了。另一种方法是:
<style>
.ui-jqgrid-caption {
text-align:center !important;
}
</style>
【讨论】: