Skip to content

Commit 8a1d44b

Browse files
author
Eugene Tupikov
committed
fixed rendering when data is empty
1 parent a3f01dd commit 8a1d44b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/renderers/TableRenderer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,13 @@ private function renderHeaderCell($column)
106106
protected function renderBody()
107107
{
108108
$rows = [];
109-
foreach ($this->data as $index => $item) {
110-
$rows[] = $this->renderRowContent($index, $item);
109+
110+
if (!empty($this->data)) {
111+
foreach ($this->data as $index => $item) {
112+
$rows[] = $this->renderRowContent($index, $item);
113+
}
114+
} else {
115+
$rows[] = $this->renderRowContent(0);
111116
}
112117
return Html::tag('tbody', implode("\n", $rows));
113118
}

0 commit comments

Comments
 (0)