block/TableTrait.php
protected function renderTable($block)
	{
		$head = '';
		$body = '';
		$cols = $block['cols'];
		$first = true;
		foreach($block['rows'] as $row) {
			$cellTag = $first ? 'th' : 'td';
			$tds = '';
			foreach ($row as $c => $cell) {
				$align = empty($cols[$c]) ? '' : ' align="' . $cols[$c] . '"';
				$tds .= "<$cellTag$align>" . trim($this->renderAbsy($cell)) . "</$cellTag>";
			}
			if ($first) {
				$head .= "<tr>$tds</tr>\n";
			} else {
				$body .= "<tr>$tds</tr>\n";
			}
			$first = false;
		}
		return $this->composeTable($head, $body);
	}
protected function renderTable($block)
	{
		$head = '';
		$body = '';
		$cols = $block['cols'];
		$first = true;
		foreach($block['rows'] as $row) {
			$cellTag = $first ? 'th' : 'td';
			$tds = '';
			foreach ($row as $c => $cell) {
				$align = empty($cols[$c]) ? '' : ' align="' . $cols[$c] . '"';
				$tds .= "<$cellTag$align>" . trim($this->renderAbsy($cell)) . "</$cellTag>";
			}
			if ($first) {
				$head .= "<tr>$tds</tr>\n";
			} else {
				$body .= "<tr>$tds</tr>\n";
			}
			$first = false;
		}
		return $this->composeTable($head, $body);
	}
render a table block