I'm currently working on a search which goes through a database and delivers the result in form of a h:dataTable in my web application. However that h:dataTable has quite a lot of optional rows.
Simple code of my h:selectManyCheckbox:
<h:panelGroup styleClass="panelGroup">
<h:selectManyCheckbox value="#{searchBean.auswahl}">
<f:selectItems value="#{searchBean.auswahl}" />
</h:selectManyCheckbox>
</h:panelGroup>
With the default layout of my h:selectManyCheckbox it simply displays all my ~30 checkboxes in one row, completely ruining the design of the site.
However after looking into the possible layout options there only seem to be two.
Either displaying them all in one row horizontally as it does by default or displaying them all in one vertically. I rather want a layout of something along the lines of several rows with 5 checkboxes each.
How do I achieve that?
Let all table cells float left as block elements and clear the float every
Xn+(X+1)child, whereXis the number of columns. To keep all nicely in line, make sure white space don't wrap and that the width is exactly100%/Xtaking into account that box sizing covers padding+border.In other words, given a:
You can create a 3-column grid as below:
And a 4-column grid as below:
And a 5-column grid as below:
And so forth.