throw new NullPointerException();
}
if (!component.isRendered()) return;
ResponseWriter writer = context.getResponseWriter();
PanelGrid comp = (PanelGrid)component;
int columns = getColumnsNumber(comp.getColumns());
// If no body, header or footer is found, then the table element will be not rendered.
if (!hasTableAnyContext(context, component)) return;
writer.startElement(Attributes.TABLE, component);
RendererUtils.writeAttribute(Attributes.ID, comp.getClientId(context), writer);
RendererUtils.writeAttribute(Attributes.CLASS, comp.getStyleClass(), writer);
RendererUtils.writeAttribute(Attributes.XML_LANG, comp.getXmllang(), writer);
RendererUtils.writeAttribute(Attributes.ALIGN, comp.getAlign(), writer);
RendererUtils.writeAttribute(Attributes.COLUMNS, comp.getColumns(), writer);
RendererUtils.writeAttribute(Attributes.TITLE, comp.getTitle(), writer);
renderHeaderOrFooter(context, component, Attributes.HEADER, columns);
renderChildern(context, component, columns);