php - PHPExcel. Get border style of a cell -
i'm converting xls/xlsx file html table , i'm trying keep embedded excel styles saved in xls file. managed detect if cell has styles:
$objphpexcel = new phpexcel(); $objphpexcel = phpexcel_iofactory::load("excelfile.xls"); $objworksheet = $objphpexcel->getactivesheet(); foreach ($objworksheet->getrowiterator() $row) { foreach ($celliterator $cell) { $background_color = $cell->getstyle()->getfill()->getstartcolor()->getrgb(); $fore_color = $cell->getstyle()->getfont()->getcolor()->getrgb(); $font_bold = $cell->getstyle()->getfont()->getbold(); $font_italic = $cell->getstyle()->getfont()->getitalic(); } }
but can't find how detect if cell has border , style border is (there's documentation setting border not retreiving borders).
you can use
->getstyle('a1')->getborders()->gettop()->getcolor()->getrgb(); ->getstyle('a1')->getborders()->gettop()->getborderstyle();
and on...
:)
Comments
Post a Comment