protected function renderTable($block)
{
$content = '';
$this->_tableCellAlign = $block['cols'];
$content .= "<thead>\n";
$first = true;
foreach ($block['rows'] as $row) {
$this->_tableCellTag = $first ? 'th' : 'td';
$align = empty($this->_tableCellAlign[$this->_tableCellCount]) ? '' : ' align="' . $this->_tableCellAlign[$this->_tableCellCount] . '"';
$this->_tableCellCount++;
$tds = "<{$this->_tableCellTag}{$align}>" . trim($this->renderAbsy($this->parseInline($row))) . "</{$this->_tableCellTag}>";
// TODO move this to the consume step
$content .= "<tr>{$tds}</tr>\n";
if ($first) {
$content .= "</thead>\n<tbody>\n";
}
$first = false;
$this->_tableCellCount = 0;
}
return "<table>\n{$content}</tbody>\n</table>\n";
}