I've found that if I add comment inside panelgrid tag, it will generate an empty <td>
for it. I've found this link about this issue: https://java.net/jira/browse/JAVASERVERFACES-1768. According to this link, it is not a bug and marked as WONTFIX. In the link, someone has provided these workarounds, I wonder if there are better solutions than these:
Let Facelets ignore all comments, if you do not want to keep them at all. There is a
javax.faces.FACELETS_SKIP_COMMENTS
switch for that inweb.xml
.Move the comment into the
<h:panelGroup>
, if you want to keep them.Use
<ui:remove><!-- first column --></ui:remove>
, you could then also ignore the XML comment-style and come up with something fancier.