SerefAltindal
SerefAltindal

Reputation: 349

How can I add scrollbars to a datatable?

This is my JSF project. I want to add to scrollbar on datatable but I can't. How can I add scrollbars?

<h:dataTable value="#{oneribean.listele()}"
             rows="5" border="0"
             var="pateta"
             class="listele1">

    <h:column>
        <f:facet name="header">
            <big><b> ÖNERİ </b> </big>
        </f:facet>
        <h:outputText value="#{pateta.aciklama}"/>
    </h:column>
    <h:column>
        <f:facet name="header">
            <big><b> DERS </b> </big>
        </f:facet>
        <h:outputText value="#{pateta.ders}"/>
    </h:column>
    <h:column>
        <f:facet name="header">
            <big><b> BÖLÜM </b> </big>
        </f:facet>
        <h:outputText value="#{pateta.bolum}"/>
    </h:column>
</h:dataTable>

Upvotes: 0

Views: 139

Answers (1)

Scorpion
Scorpion

Reputation: 587

Use PrimeFaces data table component <p:dataTable> to achieve this

<p:dataTable var="yourVar" 
             value="#{bean.YourList}" 
             scrollable="true" scrollHeight="150">
       //list your columns here.
</p:dataTable>

check this.

Upvotes: 1

Related Questions