You are here

private function PHPExcel_Writer_HTML::_createCSSStyleAlignment in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/HTML.php \PHPExcel_Writer_HTML::_createCSSStyleAlignment()

* Create CSS style (PHPExcel_Style_Alignment) * *

Parameters

PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment: * @return array

1 call to PHPExcel_Writer_HTML::_createCSSStyleAlignment()
PHPExcel_Writer_HTML::_createCSSStyle in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/HTML.php
* Create CSS style * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/HTML.php, line 896

Class

PHPExcel_Writer_HTML
PHPExcel_Writer_HTML

Code

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;
}