如何使网格的标题居中

时间:2012-04-24 12:31:35

标签: jqgrid

如何在不更改css(全局)的情况下将网格标题居中? 通过defaut,标题在左边。

2 个答案:

答案 0 :(得分:7)

我认为标题中心的代码可能是关于以下内容的

$("#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

enter image description here

答案 1 :(得分:0)

已经提出这个问题已有一段时间了。另一种方法是:

<style>
.ui-jqgrid-caption {
  text-align:center !important;
}
</style>