简体   繁体   English

如何使Tapestry的BeanEditor水平放置?

[英]How to make Tapestry's BeanEditor horizontal?

In Tapestry 5.3, BeanEditor comes in the vertical form, looking like this: 在Tapestry 5.3中,BeanEditor以垂直形式出现,如下所示:

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

Is there a property or something else that could make it become horizontal, like this? 是否存在像这样的属性或其他可能使其变为水平的状态?

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

You can achieve this by adding some custom css. 您可以通过添加一些自定义CSS来实现。 Tapestry uses good class names for you to target all elements. Tapestry使用好的类名来定位所有元素。 Just add some css with a higher specificity to overwrite the tapestry defaults. 只需添加一些具有更高特异性的 CSS即可覆盖挂毯的默认设置。

The following will give you your desired result. 以下将给您您想要的结果。 You'll have to play with it a bit (colors, widths etc.) to get it fully to your liking but this will fix the layout for you. 为了使其完全符合您的喜好,您必须对其进行一些操作(颜色,宽度等),但这将为您确定布局。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM