Changing JSF data table cell background [closed]
开发者_开发问答
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this questionHow can I change the background of a jsf data table cell? I need to change the color of the whole cell, not the background of text in it.
EDIT:
The desired result is to have a table with:
<td style="background-color: #ff9200">...</td>
where the actual background color is defined somewhere by the user and could be different for each <td>
.
It's possible to do <td><div style="background-color: ...">...</div></td>
, but that starts getting uglier.
Just use CSS to give the td
element of interest a background
property with a color of interest.
td.someclass {
background: pink;
}
You can specify CSS classes for td
elements using columnClasses
attribute of <h:dataTable>
. Alternatively, if you want to apply this on all cells of the same row, rather use rowClasses
attribute in combination with tr.someclass td
CSS selector.
精彩评论