Exemple #1
0
 /**
  * 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;
 }
Exemple #2
0
 /**
  * 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;
 }
Exemple #3
0
 /**
  * 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;
 }
Exemple #4
0
 /**
  * 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;
 }