Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Centering a checkbox in a h:dataTable column  RSS feed

 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a data table with some check boxes in it. I would like to have those checkboxes to be centered within their cells and can't get it to work. I've tried text-align: center and columnClasses with no luck. Can checkboxes even be centered? My code is as follows:

<h ataTable value="#{List.newList}" headerClass="tableHeader" var="person">
<h:column>
<f:facet name="header">
<h utputText value="Name"/>
</f:facet>
<h utputText value="#{person.Name}"/>
</h:column>

<h:column>
<f:facet name="header">
<h utputText value="Processed"/>
</f:facet>
<h:selectBooleanCheckbox value="#{person.processed}" style="text-align: center"/>
</h:column>
</h ataTable>
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got zapped by that one just the other day.

The answer is "yes", but not by applying styling at the component level.

Use the columnClasses attribute of the dataTable tag, instead.
 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did try that and still got nothing. Is there an example somewhere?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!