AM01
AM01

Reputation: 314

GWT celltable make some columns bold

I am using a GWT CellTable.

I have a requirement where i want to make just a few columns in few of the rows to be bold, depending on the data of that column.

I can't seem to find any clean implementation.

Any pointers would be helpful.

Upvotes: 1

Views: 933

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64561

If the style depends directly on the value of the cell, then you can extend Column and override getCellStyleNames.

Otherwise you can use a RowStyles to apply a CSS class name to the row (depending on the row object), use Column#setCellStyleNames on the columns where cells have to be bold, and use a descendant selector in your CSS stylesheet to only apply bold style to cells at the cross of the row and column:

.rowWithBoldCells .cellMightBeBold { font-weight: bold; }

(rowWithBoldCells is only applied to rows where some of the cells have to be bold, and cellMightbeBold is applied to all cells in a given column).

Upvotes: 1

Related Questions