/** * Create CSS style (PHPExcel_Style_Border) * * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border * @return string */ private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) { // Create CSS // $css = $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB(); // Create CSS - add !important to non-none border styles for merged cells $borderStyle = $this->_mapBorderStyle($pStyle->getBorderStyle()); $css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . ($borderStyle == 'none' ? '' : ' !important'); // Return return $css; }
/** * Create CSS style (PHPExcel_Style_Border) * * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border * @return string */ private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) { // Construct HTML $css = ''; // Create CSS $css .= $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB(); // Return return $css; }
/** * Write BorderPr * * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer * @param string $pName Element name * @param PHPExcel_Style_Border $pBorder Border style * @throws Exception */ private function _writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null) { // Write BorderPr if ($pBorder->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) { $objWriter->startElement($pName); $objWriter->writeAttribute('style', $pBorder->getBorderStyle()); // color $objWriter->startElement('color'); $objWriter->writeAttribute('rgb', $pBorder->getColor()->getARGB()); $objWriter->endElement(); $objWriter->endElement(); } }
/** * Create CSS style (PHPExcel_Style_Border) * * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border * @return string */ private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle, PHPExcel_Style_Fill $fill) { // Construct HTML $css = ''; // Create CSS $borderWidth = $this->_mapBorderStyle($pStyle->getBorderStyle()); if ($borderWidth == '0px' && $this->_isPdf) { // tcPDF treats a 0px border with a colour of black as a thick black border, so we set the colour to the // background colour for the cell if we're generating PDF output $bValue = $fill->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? 'FFFFFF' : $fill->getStartColor()->getRGB(); $css .= $borderWidth . ' #' . $bValue; } else { $css .= $borderWidth . ' #' . $pStyle->getColor()->getRGB(); } // Return return $css; }