如何使Tapestry的BeanEditor水平?

时间:2013-10-10 05:41:47

标签: java css layout tapestry

在Tapestry 5.3中,BeanEditor以垂直形式出现,如下所示:

╔════════════════════════════════════╗
║           Label1  Value1           ║
║           Label2  Value2           ║
║           Label3  Value3           ║
║           Label4  Value4           ║
╚════════════════════════════════════╝

是否有财产或其他可能使其变得水平的东西,像这样?

╔══════════════════════════════════════════════════════════════════╗
║ Label1 Value1 | Label2  Value2 | Label3  Value3 | Label4  Value4 ║
╚══════════════════════════════════════════════════════════════════╝

1 个答案:

答案 0 :(得分:2)

您可以通过添加一些自定义css来实现此目的。 Tapestry使用良好的类名来定位所有元素。只需添加一些更高specificity的css来覆盖tapestry默认值。

以下内容将为您提供所需的结果。你必须使用它(颜色,宽度等)才能完全按照自己的喜好进行游戏,但这样可以为你修复布局。

body DIV.t-beaneditor-row {
    float: left;
    width: 300px;
}

body DIV.t-beaneditor-row LABEL {
    width: 100px;
}