How to change the font size in jqGrid?
Asked Answered
G

6

14

It is already running with the ui-lightness. How do I change the font size inside the grid?

Please advise.

Thank you.

Gallop answered 5/11, 2009 at 0:56 Comment(0)
M
28

There is an excellent post about this on the jqGrid Forum.

Essentially you can do what Mano suggests and modify the css file directly, or you can create your own in-line style if you need more flexibility. For example:

.ui-jqgrid {font-size:0.8em}

If you do create an inline style you may need to make it more specific to pick up grid rows:

.ui-jqgrid tr.jqgrow td {font-size:0.8em}
Meanly answered 17/12, 2009 at 15:46 Comment(1)
sorry for the late late uptick. better late than never. i even forgotten why i asked that question. weird. hope this helps other people.Gallop
S
6

The very first line in ui.jqgrid.css is this:

 .ui-jqgrid{position:relative;font-size:11px;}

Change the font-size to what you need.

Slow answered 16/11, 2009 at 2:39 Comment(0)
E
3

I recently did this for version 4.5.4 of the jqGrid, and had to override more than just the parent .ui-jqgrid selector. In this example, I wanted all text anywhere in the grid to be 12px versus the default of 11px:

/* Bump up the font-size in the grid */
.ui-jqgrid,
.ui-jqgrid .ui-jqgrid-view,
.ui-jqgrid .ui-jqgrid-pager,
.ui-jqgrid .ui-pg-input {
    font-size: 12px;
}

Note that this was done in a separate CSS file, not by directly editing the packaged CSS file.

Edirne answered 30/10, 2013 at 20:7 Comment(0)
S
1

You can also format a specific grid column by referencing it in your custom css by the grid name and use the aria-describedby property to target the specific column. For example:

#Mygrid td[aria-describedby="Mygrid_myspecialcolumnname"] { font-size: 14px; }

You can read more about aria-describedby here: http://www.w3.org/TR/WCAG-TECHS/ARIA1.html

Statocyst answered 25/10, 2013 at 19:27 Comment(0)
P
0

In the latest version - Guriddo_jqGrid_JS_4.8.2, inorder to change the font style of grid-row elements, just this one change worked for me - in ui.jqgrid.css

.ui-jqgrid tr.jqgroup td {font-weight: bold; font-size: 12px;}
Pargeting answered 15/4, 2015 at 10:43 Comment(0)
M
0

Please remove this post - it is related to another product (jsgrid) and the below solution will confuses the users of jqGrid

As of Sept 2021, the method that worked for me is:

.jsgrid table {font-size: XX; }

table {} also works, but for obvious reasons better to be more specific.

Alternately, .jsgrid td, or .jsgrid tr also works

Marucci answered 21/9, 2021 at 4:31 Comment(1)
Thee question is related to jqGrid not jsgrid, which is quite diffrentBerlauda

© 2022 - 2024 — McMap. All rights reserved.