JSF-可滚动数据表
有没有办法实现一个可滚动的datatable而不使用RichFaces?如果有人能告诉我一些代码示例或示例页面吗?谢谢 这可以通过CSS实现。必须使用css属性overflow:scroll或overflow-x和overflow-y。但请注意,不同的浏览器对该属性的处理方式不同,因此您可能会发现它会导致不同的行为 将h:dataTable包装到div中。 使用css更改div的属性,并将溢出属性添加到滚动。 确保您的桌子有固定大小的桌子 你可能想看看这个JSF-可滚动数据表,jsf,Jsf,有没有办法实现一个可滚动的datatable而不使用RichFaces?如果有人能告诉我一些代码示例或示例页面吗?谢谢 这可以通过CSS实现。必须使用css属性overflow:scroll或overflow-x和overflow-y。但请注意,不同的浏览器对该属性的处理方式不同,因此您可能会发现它会导致不同的行为 将h:dataTable包装到div中。 使用css更改div的属性,并将溢出属性添加到滚动。 确保您的桌子有固定大小的桌子 你可能想看看这个 -干杯:)这可以通过CSS实现。必须
-干杯:)这可以通过CSS实现。必须使用css属性overflow:scroll或overflow-x和overflow-y。但请注意,不同的浏览器对该属性的处理方式不同,因此您可能会发现它会导致不同的行为 将h:dataTable包装到div中。 使用css更改div的属性,并将溢出属性添加到滚动。 确保您的桌子有固定大小的桌子 你可能想看看这个
-干杯:)在jsf中为可滚动数据表使用
div
组件,并提及
属性<代码>高度:200px;溢出:自动代码>在样式
属性中
<div style="height: 200px; overflow: auto;">
<h:dataTable value="#{facesBean.files}" var="file">
<h:column>
<f:facet name="header">
<h:outputText value="Image"></h:outputText>
</f:facet>
<h:graphicImage value="#{files.image}" style="width:100px; height:100px;"></h:graphicImage>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Description"></h:outputText>
</f:facet>
<h:outputText style="font-weight:bold;" value="File Name:"></h:outputText>
<h:outputText value="#{file.alt}"></h:outputText>
</h:column>
</h:dataTable>
</div>
在jsf中为可滚动数据表使用
div
组件
属性<代码>高度:200px;溢出:自动代码>在样式
属性中
<div style="height: 200px; overflow: auto;">
<h:dataTable value="#{facesBean.files}" var="file">
<h:column>
<f:facet name="header">
<h:outputText value="Image"></h:outputText>
</f:facet>
<h:graphicImage value="#{files.image}" style="width:100px; height:100px;"></h:graphicImage>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Description"></h:outputText>
</f:facet>
<h:outputText style="font-weight:bold;" value="File Name:"></h:outputText>
<h:outputText value="#{file.alt}"></h:outputText>
</h:column>
</h:dataTable>
</div>