David Zhao
David Zhao

Reputation: 4514

How to increase/descrease font size in Dojo DataGrid

How can I increase/decrease the default dojo datagrid font size? Should I do this in CSS or is there a property I can set when extending the DataGrid class?

Upvotes: 3

Views: 4657

Answers (2)

Lee
Lee

Reputation: 941

Building off what Kitson said, you can do something like this:

<style type="text/css">
.dojoxGrid table {
   margin: 0;
}
.dojoxGrid th, tr {
   font-size: 8pt;
}
</style>

But as Kitson mentioned, Firebug can be very useful in discovering what class you should use in your style sheet. These are two classes that I happened to pick out using that method.

Upvotes: 5

Kitson
Kitson

Reputation: 1678

You should set it in CSS... Always set visual sizing in CSS with dojo/dijit/dojox.

Sometimes the documentation of the CSS you should be specifying isn't clear, so I tend to use FireBug on the rendered page to identify the element and the class that has been assigned and set the CSS that way. The grid is particularly difficult because even though they have done a good job with it, it does render slightly differently in different browsers because of the limitations of each browser (IE6 being the biggest pain).

I just looked at an app of mine at it seems the class is rather straightforward, being dojoxGrid

Upvotes: 2

Related Questions