If you want to style tables in a generic manner, just change the CSS selectors accordingly. The <table>
of <p:dataTable>
is selectable by the ui-datatable
class.
.ui-datatable td {
background: pink;
}
If you want to style only a specific table in a specific manner, rather give it a classname so that you can select by the classname instead of by ID.
E.g.
<p:dataTable styleClass="foo">
is overrideable by .ui-datatable.foo {}
. E.g.
.ui-datatable.foo td {
background: hotpink;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…