开发者

Changing JSF data table cell background [closed]

开发者 https://www.devze.com 2023-02-13 11:28 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_开发问答
Closed. This question needs to be more focused. It is not currently accepting answers.
开发者_开发问答

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 question

How 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消