更改gwt中flextable的字体大小
我想知道是否有人知道如何更改 GWT 中弹性表的字体大小?我尝试了无数次尝试,并在网上到处查找,但似乎没有解决方案有效。我在 GWT 中有一个 flexTable ,以及许多标签,例如...
user_info.setText(5, 0, "Organization:");
目前我一直在尝试使用代码在 CSS 页面中编写样式,
.smallFont
{
font-size: 6pt;
background-color: #66ff66;
}
我将 flexTable 设置为该样式并且表格的背景发生了变化,但是字体没有。任何帮助将不胜感激。我在网上到处都查过了。我什至尝试通过执行以下操作来更改每个组件的默认样式页面...
.gwt-FlexTable
{
font-size: 6pt;
background-color: #66ff66;
}
但无济于事...
所以令人沮丧=(
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 = (
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 firebug 找出 GWT 的 CSS 样式,然后在我的 CSS 文件中使用“!important”来覆盖现有的 CSS 样式。下面有一个例子。
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.
使用 !important 语句覆盖通过 XML 导入的 CSS。
或者,如果需要,您可以下载这些基本 css 文件,手动包含它们的副本,注释掉 xml 中的所有内容,并进行完整的样式控制。
例如,这是 clean.css 文件:
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
具体来说,要更改 GWT Flex Table 中的字体(假设您正在导入 clean.css),请将此示例添加到您的自定义 css 文件中并覆盖您导入的表 td 样式:
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: