How to center a grid title

How to center a grid title without changing css (which is global)? Deactivate the title on the left.

+3
source share
2 answers

I think the code that centers the header might be something like the following

$("#grid").closest("div.ui-jqgrid-view")
    .children("div.ui-jqgrid-titlebar")
    .css("text-align", "center")
    .children("span.ui-jqgrid-title")
    .css("float", "none");

See the demo :

enter image description here

+7
source

Some time has passed since this question was raised and an answer was received. Another approach would be:

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

All Articles