Community
Participate
Working Groups
Table cell has no padding to define.
A custom cell padding can now be applied using the following CSS snippet: Table-Cell { padding: 4px; } Changes are in CVS HEAD.
Created attachment 128890 [details] table with spacing Hi Ralf, I'm very appreciate for your help. It works fine by me with the spacing in table. I have just found a little problem in it, that by colorizing the table the place for spacing could not be colorized (please see the screenshot). Steps to reproduce: 1. go to the rap demo project "org.eclipse.rap.demo" 2. under the package "org.eclipse.rap.demo.controls" there is a java datei called "TableViewerTab" 3. at the end of the method "createExampleControls" please paste this code: Table table = this.viewer.getTable(); for( int i = 0; i < table.getItemCount(); i++ ) { TableItem item = table.getItem( i ); if( i % 2 == 0 ) { item.setBackground( Graphics.getColor( 244, 246, 245 ) ); } else { item.setBackground( Graphics.getColor( 255, 0, 0 ) ); } } 4. run this demo and then you will see the problem. Thanks for your help again!
bug reopened.
Thanks for pointing out this problem. There seems to be no other way to implement cell padding, so we have to keep the current solution and find a workaround for background colors. I opened a separate bug for this: bug 268782. Wen, do you know that you can also achieve alternating row colors by means of theming (bug 235092)? Here's an example: TableItem:even { background-color: rgb( 244, 246, 245 ); }
Hi Ralf, thanks so much for your help. The way you advised (colorizing the table with css definition) is a declarative solution. What we need to face is a very complicated table-colorizing. So I ask you how it's going programmatically :-) But I still tested your suggestion with the css definition. I found, the "theme.css" in the rap demo project from the cvs head has already such definition, but the table has shown just no color. The snippet from the css datei: /* Alternating row colors */ List-Item:even, TableItem:even { background-color: rgb(255, 0, 0); // I just change this color in red } Can you give me several words about that? Thanks a lot. Wen
There seems to be an layout error when using images. I added the following to by css: Table-Cell { spacing: 5px; padding: 0px 5px 0px 5px; } Now look at the screenshot1. The image is shifted to the right 5px, but text seems not to shift. The spacing also does not seem to take an effect. Change to: Table-Cell { spacing: 5px; padding: 0px 0px 0px 0px; } There is no space between image and text, see screenshot2.
Created attachment 128966 [details] Screenshot1
Created attachment 128967 [details] Screenshot2
(In reply to comment #6) There was still a bug that shrinked all spacing to zero. This is also fixed in CVS HEAD.
(In reply to comment #5) Wen, this snippet works as expected here. Do you use RWT from CVS HEAD? Sure you activated the theme? If you have any more questions on how get the theming to work, don't hesitate to ask on our newsgroup. Best Regards, Ralf
Hi Ralf, the layout is still wrong. The attached screenshot3 is the result of using: Table-Cell { spacing: 5px; padding: 0px 15px 0px 15px; }
Created attachment 129061 [details] Screenshot3
The theming wasn't activated as you said. Now I got it by me to work. Thank you Ralf. But I found something else. It seems to be another error with the cell padding. But I'm not quite sure about that. Steps to reproduce: 1) Open the rap demo project "org.eclipse.rap.demo" 2) Take this snippet TableViewerTab.java under the package org.eclipse.rap.demo.controls instead of the old one 4) Add in "theme.css" this snippet: Table-Cell { padding: 4px; } 3) Start this demo, call the entry point with theming and open the tab TableViewer 4) Click the second column (with CheckboxEditor in it) and you will see something wrong with the checkbox position. Click the first or the third column (with TextEditor) you will find the wrong position of the texteditor, too. Could you take a look at it, Ralf? Thanks a lot. Wen
Created attachment 129072 [details] snippet to reproduce
Created attachment 129073 [details] error with the cell editor position 1
Created attachment 129074 [details] error with the cell editor position 2
(In reply to comment #11) Thanks for the hint. The calculation was still wrong for tables without columns. Fixed in HEAD.
(In reply to comment #13) Hi Wen, I opened a separate bug for this problem: bug 269065. In the meantime, you can work around this problem by setting the padding to 0px (as it was before).
(In reply to comment #17) > (In reply to comment #11) > Thanks for the hint. The calculation was still wrong for tables without > columns. Fixed in HEAD. > Thanks, now it works.