Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF h:column tag fix width

Tags:

jsf

Can someone show me how to fix the width of a column in a datatable with JSF?

My code currently reads:

<h:column>
    <f:facet name="header">
        <h:outputText value="Data Field 1" />
    </f:facet>
    <h:commandLink id="dataLink" action="#{pc_SearchResultsFragment.setField1}">
        <h:outputText value="#{(qi.data1 != null) ? '' : qi.data1}"/>                 
    </h:commandLink>
</h:column>

Thanks!

like image 413
Elie Avatar asked Nov 28 '08 18:11

Elie


1 Answers

Well usually you use h:column in a dataTable context.

What you could do is set the width in CSS. If you have the code:

<h:dataTable value="#{action.items}" var="name" 
styleClass="tableClass" columnClasses="first,second">

And in the CSS file you do:

.first {

   width: 250px;

}

That is assuming you have 2 columns.

Check the dataTable properties here, also you can find there all kind of CSS related properties.

like image 85
Alexandru Luchian Avatar answered Oct 04 '22 14:10

Alexandru Luchian