How to set colspan and rowspan in JSF panelGrid?

None of both is possible with the standard JSF implementation. There are 3 ways to fix this:

  1. Write plain HTML yourself. A <h:panelGrid> basically renders a HTML <table>. Do the same.
  2. Create a custom HTML renderer which supports this. It’ll however be a lot of sweat and pain.
  3. Use a 3rd party component library which supports this.
    • Tomahawk has a <t:panelGroup> component which supports colspan in <h:panelGrid>.
    • RichFaces (3.x only) has a <rich:column> component which supports both colspan and rowspan in <rich:dataTable>.
    • PrimeFaces has a <p:row> next to <p:column> which is supported in both <p:panelGrid> and <p:dataTable> (also with <p:columnGroup>).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)