Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Multi line headers in table columns
Multi line headers in table columns [message #901764] Tue, 14 August 2012 13:42 Go to next message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
Since RAP 1.5 [1] it's possible to add line breaks to the header of a table column. The header is always center aligned in the vertical direction. Is it possible to align the header differently?

The header cell containing the most line breaks gets the padding defined in the CSS file under TableColumn->padding. Other header cells containing less line breaks have a higher top padding value. However, I couldn't find out where the calculation is done in the RAP code. Can you give me a hint?

[1] http://www.eclipse.org/rap/noteworthy/1.5/

[Updated on: Tue, 14 August 2012 13:42]

Report message to a moderator

Re: Multi line headers in table columns [message #901950 is a reply to message #901764] Wed, 15 August 2012 09:19 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi!

> Since RAP 1.5 [1] it's possible to add line breaks to the header of a
> table column. The header is always center aligned in the vertical
> direction. Is it possible to align the header differently?

Right now it's not. There is a bug for that:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=361796

However, a leading line break is respected, so you can at least get a
bottom alignment if you only have columns with two and one line break.
(e.g. "My\nText" and "\nMyText")

>
> The header cell containing the most line breaks gets the padding defined
> in the CSS file under TableColumn->padding. Other header cells
> containing less line breaks have a higher top padding value.

Uhmmm, no. The padding should be the same for all column header. If the
header is higher than content+padding+border, the content is centered
within the area left after subtracting border and padding. That is
hardcoded (right now) in the javascript code.

Or do you mean something different?

Greetings,
Tim


--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Multi line headers in table columns [message #901995 is a reply to message #901950] Wed, 15 August 2012 12:35 Go to previous messageGo to next message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
Hi Tim,


Quote:

Right now it's not. There is a bug for that:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=361796


I'm aware of this bug. We've already applied the submitted patch to enable vertical alignment in table columns.
However, I need to define a different vertical alignment for the table header and for the other cells in the table column.

Quote:

Uhmmm, no. The padding should be the same for all column header. If the
header is higher than content+padding+border, the content is centered
within the area left after subtracting border and padding. That is
hardcoded (right now) in the javascript code.


If you have a header with 3 columns each containing a header text with 1, 2 or 3 lines respectively, the CSS property "top" for positioning of the header text has a different value for each case. That's why I guessed that the calculation of the position must be done somewhere, which finally results in a center alignment (the CSS property text-vertical-align is NOT used).

Could you tell me in which Javascript file the position of the header text is calculated?
Re: Multi line headers in table columns [message #902188 is a reply to message #901995] Thu, 16 August 2012 09:29 Go to previous message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi!

> If you have a header with 3 columns each containing a header text with
> 1, 2 or 3 lines respectively, the CSS property "top" for positioning of
> the header text has a different value for each case. That's why I
> guessed that the calculation of the position must be done somewhere,
> which finally results in a center alignment (the CSS property
> text-vertical-align is NOT used).

Yes, all HTML elements in RAP always get absolute css positions, the top
property is the result of all the aforementioned calculations.

>
> Could you tell me in which Javascript file the position of the header
> text is calculated?

That code is shared between many widgets, so it wouldn't be a good idea
to change that. If you want to change the default vertical alignment,
you could try to edit Table.appearance.js/Tree.appearance.js, which have
a "tree-column"/"table-column" map. There a line like
result.verticalChildrenAlign = "bottom";
*might* do what you want. I did not test it.

Greetings,
Tim

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:ImageRegistry is not serializable
Next Topic:How to do a loading page
Goto Forum:
  


Current Time: Tue Apr 23 06:46:39 GMT 2024

Powered by FUDForum. Page generated in 0.03154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top