Skip to content

Commit

Permalink
fixed rendering when data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Tupikov committed Aug 28, 2015
1 parent a3f01dd commit 8a1d44b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/renderers/TableRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ private function renderHeaderCell($column)
protected function renderBody()
{
$rows = [];
foreach ($this->data as $index => $item) {
$rows[] = $this->renderRowContent($index, $item);

if (!empty($this->data)) {
foreach ($this->data as $index => $item) {
$rows[] = $this->renderRowContent($index, $item);
}
} else {
$rows[] = $this->renderRowContent(0);
}
return Html::tag('tbody', implode("\n", $rows));
}
Expand Down

0 comments on commit 8a1d44b

Please sign in to comment.