Skip to content

Commit 80df5be

Browse files
authored
add override cell tag
1 parent fea7328 commit 80df5be

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/LaravelHtmlTableGenerator.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,32 @@ private function _rows_data(array $data)
9191
$output .= $this->_tags[$alter.'body_row'];
9292
foreach($row1 as $row)
9393
{
94-
94+
$body_cell_tag_close = $this->_tags['body_cell_end'];
9595
if(is_array($row) && array_key_exists('data',$row))
9696
{
9797
$data = $row['data'];
9898
unset($row['data']);
9999

100-
$tag = trim($this->_tags[$alter.'body_cell'],'>').$this->_attributeToString($row).'>';
100+
if(isset($row['body_cell_tags']))
101+
{
102+
$body_cell_tag = $row['body_cell_tags'];
103+
$body_cell_tag_open = $body_cell_tag['open'];
104+
$body_cell_tag_close = $body_cell_tag['close'];
105+
}
106+
else
107+
{
108+
$body_cell_tag_open = trim($this->_tags[$alter.'body_cell'],'>').$this->_attributeToString($row).'>';
109+
}
101110
}
102111
else
103112
{
104113
$data = $row;
105114
$attrib = '';
106-
$tag = $this->_tags[$alter.'body_cell'];
115+
$body_cell_tag_open = $this->_tags[$alter.'body_cell'];
107116
}
108117

109118

110-
$output .= $tag.$data.$this->_tags['body_cell_end'];
119+
$output .= $body_cell_tag_open.$data.$body_cell_tag_close;
111120
}
112121
$output .= $this->_tags['body_row_end'];
113122

@@ -345,4 +354,4 @@ private function _getDefaultTags()
345354
'alt_body_cell_end' => '</td>'
346355
];
347356
}
348-
}
357+
}

0 commit comments

Comments
 (0)