Skip to content

Commit 9620c71

Browse files
Merge pull request SpartnerNL#403 from Tucker-Eric/2.0
Add inline cell formatting to blade
2 parents 98afe94 + f729923 commit 9620c71

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Maatwebsite/Excel/Readers/HtmlReader.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ protected function _processDomElement(DOMNode $element, $sheet, &$row, &$column,
317317
$this->parseValign($sheet, $column, $row, $attribute->value);
318318
break;
319319

320+
// Cell format
321+
case 'data-format':
322+
$this->parseDataFormat($sheet, $column, $row, $attribute->value);
323+
break;
324+
320325
// Inline css styles
321326
case 'style':
322327
$this->parseInlineStyles($sheet, $column, $row, $attribute->value);
@@ -768,6 +773,19 @@ protected function insertImageBySrc($sheet, $column, $row, $attributes)
768773
$this->parseHeight($sheet, $column, $row, $drawing->getHeight());
769774
}
770775

776+
/**
777+
* Set cell data format
778+
* @param LaravelExcelWorksheet $sheet
779+
* @param string $column
780+
* @param integer $row
781+
* @param integer $width
782+
* @return void
783+
*/
784+
protected function parseDataFormat($sheet, $column, $row, $format)
785+
{
786+
$sheet->setColumnFormat([$column.$row => $format]);
787+
}
788+
771789
/**
772790
* Set column width
773791
* @param LaravelExcelWorksheet $sheet

0 commit comments

Comments
 (0)