开发者

SmartGWT: horizontally center an HTMLFlow

开发者 https://www.devze.com 2023-04-09 23:04 出处:网络
I got an VLayout which occupies 100% of width on the screen. It contains some HTMLFlow elements, they all are centered. There is one Flow that has the same width as the screen and I want开发者_运维问

I got an VLayout which occupies 100% of width on the screen.

It contains some HTMLFlow elements, they all are centered. There is one Flow that has the same width as the screen and I want开发者_运维问答 to "split" it in 2

e.g. from

                            "Time remaining: 01:01:01"

to

                               "Time remaining: 
                                   01:01:01"

So, I tried setting the flow width to 50%, which controls my HTMLFlow length perfectly, but then the align moves to the left,

"Time remaining: 
01:01:01"

then I tried to include it inside an HLayout so it remains centered but the width gets override and is not 50% width but less.

                                    "Time 
                                  remaining: 
                                   01:01:01"

How I do this?


Can't you just add <br />s to the HTML-string. There is no way to control linewrapping in SmartGWT's HTMLFlow itself.

From HTMLFlow's JavaDoc:

Use the HTMLFlow component to display HTML content that should expand to its natural size without scrolling. [..] NOTE: Since the size of an HTMLFlow component is determined by its HTML contents, this component will draw at varying sizes if given content of varying size.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号