/** * Create CSS style (PHPExcel_Style_Alignment) * * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment * @return array */ private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) { // Construct CSS $css = array(); // Create CSS $css['vertical-align'] = $this->_mapVAlign($pStyle->getVertical()); if ($textAlign = $this->_mapHAlign($pStyle->getHorizontal())) { $css['text-align'] = $textAlign; if (in_array($textAlign, array('left', 'right'))) { $css['padding-' . $textAlign] = (string) ((int) $pStyle->getIndent() * 9) . 'px'; } } // Return return $css; }
/** * Create CSS style (PHPExcel_Style_Alignment) * * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment * @return string */ private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) { // Construct HTML $html = ''; // Create CSS $html .= ' vertical-align: ' . $this->_mapVAlign($pStyle->getVertical()) . ';' . "\r\n"; $html .= ' text-align: ' . $this->_mapHAlign($pStyle->getHorizontal()) . ';' . "\r\n"; // Return return $html; }
/** * Create CSS style (PHPExcel_Style_Alignment) * * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment * @return array */ private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) { // Construct CSS $css = array(); // Create CSS $css['vertical-align'] = $this->_mapVAlign($pStyle->getVertical()); if ($textAlign = $this->_mapHAlign($pStyle->getHorizontal())) { $css['text-align'] = $textAlign; } // Return return $css; }
/** * Create CSS style (PHPExcel_Style_Alignment) * * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment * @return string */ private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) { // Construct CSS $css = ''; // Create CSS $css .= 'vertical-align: ' . $this->_mapVAlign($pStyle->getVertical()) . '; '; $css .= 'text-align: ' . $this->_mapHAlign($pStyle->getHorizontal()) . '; '; // Return return $css; }