david
david

Reputation: 375

change font size of a flextable in gwt

I was wondering if anyone knew how to change the font size of a flextable in GWT? I've tried numerous attempts and looked online everywhere but no solution seems to work. I have a flexTable in GWT, and a number of labels like...

user_info.setText(5, 0, "Organization:");

Currently I've been trying to write a style in a CSS page with the code

.smallFont
{
    font-size: 6pt;
    background-color: #66ff66;
}

I set the flexTable to that style and the background of the table changes, but the font does not. Any help would greatly be appreciated. I've looked online everywhere. I've even tried changing the default styling page for each component by doing ...

.gwt-FlexTable
{
    font-size: 6pt;
    background-color: #66ff66;
}

but to no avail...

So discouraging = (

Upvotes: 0

Views: 1651

Answers (2)

user2449479
user2449479

Reputation: 1

Override the CSS imported via your XML with the !important statement.

Or if needed, you can just download those base css files, manually include a copy of them, comment out everything in the xml, and have full style control.

Here's the clean.css file for example:

http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/theme/clean/public/gwt/clean/clean.css?r=10894

Specifically, to change the font in a GWT Flex Table (assuming you are importing clean.css), add this example to your custom css file and override the table td style you imported:

table td{   
    font: 18px Arial, sans-serif !important;
}

Upvotes: 0

iavci
iavci

Reputation: 209

I used firebug to find out the CSS styles of GWT, then in my CSS file I used "!important" to override the existing CSS styles. There is an example below.

.gwt-TabPanelBottom {
   border-width: 1px !important;
   background: none no-repeat scroll center center #F6F6FF !important;
   padding: 0 !important;
   border: 2px solid #BFCC99 !important;    
}

Upvotes: 1

Related Questions