fix: [helpers:bootstrap] Correctly closes tr tag

pull/39/head
mokaddem 2021-02-23 07:59:26 +01:00
parent 51399903bd
commit ebb388ae60
1 changed files with 6 additions and 2 deletions

View File

@ -496,8 +496,12 @@ class BoostrapTable extends BootstrapGeneric {
!empty($this->options['bodyClass']) ? $this->options['bodyClass'] : '' !empty($this->options['bodyClass']) ? $this->options['bodyClass'] : ''
], ],
]); ]);
$body .= BootstrapGeneric::genNode('tr');
foreach ($this->items as $i => $row) { foreach ($this->items as $i => $row) {
$body .= BootstrapGeneric::genNode('tr',[
'class' => [
!empty($row['_rowVariant']) ? "table-{$row['_rowVariant']}" : ''
]
]);
if (array_keys($row) !== range(0, count($row) - 1)) { // associative array if (array_keys($row) !== range(0, count($row) - 1)) { // associative array
foreach ($this->fields as $i => $field) { foreach ($this->fields as $i => $field) {
if (is_array($field)) { if (is_array($field)) {
@ -519,8 +523,8 @@ class BoostrapTable extends BootstrapGeneric {
$body .= '</td>'; $body .= '</td>';
} }
} }
}
$body .= '</tr>'; $body .= '</tr>';
}
$body .= '</tbody'; $body .= '</tbody';
return $body; return $body;
} }