0

I intend to build, using Primefaces and using the tag p:dataTable, something like this:

Desired Table

So the goal is for the second row headers to be twice as tall as the first row headers.

I have this code:

        <p:dataTable>

        <p:columnGroup type="header">
            <p:row>
                <p:column colspan="1" rowspan="1" headerText="Header 1" />
                <p:column colspan="1" rowspan="1" headerText="Header 2" />
            </p:row>
            <p:row>
                <p:column colspan="1" rowspan="2" headerText="Header 3" />
                <p:column colspan="1" rowspan="2" headerText="Header 4" />
            </p:row>
        </p:columnGroup>

    </p:dataTable>

But what I get is this (the headers are with the same height):

Primefaces Table Can someone help? Thank you.

  • There are no other columns on the 2nd (and required) 3rd row for the column headers to span multiple rows, so this all seems to be displayed as it should. Just use CSS then to make the header larger – Kukeltje Jul 29 '20 at 08:40
  • How can i do this 'There are no other columns on the 2nd (and required) 3rd row' in the code i put? @Kukeltje – miguelrocha19 Jul 30 '20 at 19:55
  • 1
    Like in the PrimeFaces showcase https://www.primefaces.org/showcase/ui/data/datatable/group.xhtml – Kukeltje Jul 30 '20 at 20:12
  • But in the code I put, if I want to make the sub-headers occupy two rows vertically, what would I have to change? – miguelrocha19 Jul 30 '20 at 21:17
  • See the last sentence in my first comment (rowspan=2 is useless) – Kukeltje Jul 30 '20 at 22:22

0 Answers0