本文整理汇总了PHP中PHPExcel_Style_Border::getBorderStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Style_Border::getBorderStyle方法的具体用法?PHP PHPExcel_Style_Border::getBorderStyle怎么用?PHP PHPExcel_Style_Border::getBorderStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Style_Border
的用法示例。
在下文中一共展示了PHPExcel_Style_Border::getBorderStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createCSSStyleBorder
/**
* 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;
}
示例2: _createCSSStyleBorder
/**
* 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;
}
示例3: _writeBorderPr
/**
* 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();
}
}
示例4: _createCSSStyleBorder
/**
* 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;
}