开发者

SmartGWT: horizontally center an HTMLFlow

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜