Skip to content

Commit

Permalink
add override cell tag
Browse files Browse the repository at this point in the history
  • Loading branch information
lloricode authored Aug 10, 2017
1 parent fea7328 commit 80df5be
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/LaravelHtmlTableGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,32 @@ private function _rows_data(array $data)
$output .= $this->_tags[$alter.'body_row'];
foreach($row1 as $row)
{

$body_cell_tag_close = $this->_tags['body_cell_end'];
if(is_array($row) && array_key_exists('data',$row))
{
$data = $row['data'];
unset($row['data']);

$tag = trim($this->_tags[$alter.'body_cell'],'>').$this->_attributeToString($row).'>';
if(isset($row['body_cell_tags']))
{
$body_cell_tag = $row['body_cell_tags'];
$body_cell_tag_open = $body_cell_tag['open'];
$body_cell_tag_close = $body_cell_tag['close'];
}
else
{
$body_cell_tag_open = trim($this->_tags[$alter.'body_cell'],'>').$this->_attributeToString($row).'>';
}
}
else
{
$data = $row;
$attrib = '';
$tag = $this->_tags[$alter.'body_cell'];
$body_cell_tag_open = $this->_tags[$alter.'body_cell'];
}


$output .= $tag.$data.$this->_tags['body_cell_end'];
$output .= $body_cell_tag_open.$data.$body_cell_tag_close;
}
$output .= $this->_tags['body_row_end'];

Expand Down Expand Up @@ -345,4 +354,4 @@ private function _getDefaultTags()
'alt_body_cell_end' => '</td>'
];
}
}
}

0 comments on commit 80df5be

Please sign in to comment.