final Iterator<UIDataSection> sectionIter = dataForm.getChildrenOfType(UIDataSection.class);
boolean sections = false;
while (sectionIter.hasNext()) {
sections = true;
final UIDataSection section = sectionIter.next();
final Element<UIDataSection> tbody = table.writeElement("tbody", section);
final UIComponent sectionHeader = section.getFacet("header");
final UIComponent sectionFooter = section.getFacet("footer");
if (sectionHeader != null) {
final Element<UIComponent> tr = tbody.writeElement("tr", sectionHeader);
final Element<UIComponent> th = tr.writeElement("th");
th.writeAttribute("scope", "rowgroup");
th.writeAttribute("colspan", colspan);
th.doEncode();
th.close();
tr.close();
}
if (section instanceof UIDataArea) {
final Element<UIDataSection> tr = tbody.writeElement("tr");
final Element<UIDataSection> td = tr.writeElement("td");
td.writeAttribute("colspan", colspan);
td.doEncode();
td.close();
tr.close();
} else {
encodeCells(tbody, section.getChildrenOfType(UIDataCell.class), columns);
}
if (sectionFooter != null) {
final Element<UIComponent> tr = tbody.writeElement("tr", sectionFooter);
final Element<UIComponent> th = tr.writeElement("th");