PDA

View Full Version : Multiple lines in a table cell



Orion-
16 May 2008, 3:50 AM
Hi,

I created a table using classes TableColumn, TableColumnModel, TableViewer. For one specific column, I would like to allow each cell to have multiple lines.

In the HTML, each cell receives the class "my-tbl-item-cell-overflow", which sets "white-space" to "nowrap" from ext-all.css. The only way I found to change this, is to set "white-space" to "normal" for class "my-tbl-item-cell-text" in my css file. But this affects all columns.

Is there another solution ? What is the best (or correct) way to change this ? Any ideas ?

Orion-

darrellmeyer
17 May 2008, 2:08 PM
You can assign a new style to the table and then prefix the overflow style with the new style.



table.addStyleName("wrap-table");

// CSS
.wrap-table .my-tbl-item-cell-overflow {
}

Orion-
19 May 2008, 12:05 AM
Thank you for the tip. This is better than what I did. But I would prefer to apply this style to just one column of my table. Is there a way to do it ?

Orion-
19 May 2008, 7:45 AM
Another question : in the same table, in another column, I have clickable text on one line. I would like that the whole cell is clickable. I add style to my "a" to make it "display: block". Like that, the whole line is now clickable, but there is still some space above an below my link, but still in the cell, that cannot be clicked.

I tried to change the style for my-tbl-item-cell-text and my-tbl-item-cell-overflow, but couldn't get my expected results. For example, if I add the style "display:block" to my-tbl-item-cell-overflow, but then I don't have multiple lines any more.

I am not an expert in CSS. Can something be done ?

Thank you in advance for any answer.
Orion-

darrellmeyer
22 May 2008, 7:20 PM
I have made a change to table to support custom styles are columns and cells. The following styles are now added to headers and cells:

.my-tbl-col-[column id] { each column }

.my-tbl-td-[column index] { cell td }
.my-tbl-td-inner-[column index] { cell inner element }
.my-tbl-td-cell-[column index] { cell text element }


I have clickable text on one line. I would like that the whole cell is clickable.Forget listening to events on the link or cell content. Just listener for CellClick on the table.

leonate
4 Jul 2008, 2:34 PM
The following styles are now added to headers and cells:

.my-tbl-col-[column id] { each column }

.my-tbl-td-[column index] { cell td }
.my-tbl-td-inner-[column index] { cell inner element }
.my-tbl-td-cell-[column index] { cell text element }

Hi Darrel,

I am trying to use these styles to set specific formatting for some column in a paging table (I use GXT-1.0-RC2). But it looks like only the column style .my-tbl-col-[column id] is working and is applied to header.
All cell styles do not work. I checked generated HTML in IE DevToolbar and did not found any such styles (like my-tbl-td-1 for example) applied to the table.
What can be wrong?