styles in datatable

hi,

i have a datatable with some rows and columns.

i would like to center the text in my columns:

<h:column>

<f:facet name="header">

<h:outputText value="#{myMsg.myMsg1}" style="text-align: center"/>

</f:facet>

<h:outputText value="#{myMsg.myMsg2}" style="text-align: center"/>

</h:column>

unfortunately only myMsg1 is centered, the other one not.

why?

[583 byte] By [naekoa] at [2007-11-27 7:49:01]
# 1

You can use the columnClasses attribute of datatable to set the column style with CSS:

columnClasses="codeColumn, descColumn, changeColumn"

And in the CSS:

.changeColumn

{

text-align: center;

nowrap: true;

width: 225px;

}

.codeColumn

{

text-align: center;

nowrap: true;

width: 225px;

}

Illu

Illua at 2007-7-12 19:29:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
See Illu fine answer. But also take a look at the generated HTML to see what is happening.
RaymondDeCampoa at 2007-7-12 19:29:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
thanks, IIIu answers did it
naekoa at 2007-7-12 19:29:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...