• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Centering a checkbox in a h:dataTable column

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Saloon Keeper
Posts: 28424
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did try that and still got nothing. Is there an example somewhere?
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic