You are here

private function PHPExcel_Writer_HTML::_setMargins 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::_setMargins()
1 call to PHPExcel_Writer_HTML::_setMargins()
PHPExcel_Writer_HTML::_generateTableHeader in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/HTML.php
* Generate table header * *

File

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

Class

PHPExcel_Writer_HTML
PHPExcel_Writer_HTML

Code

private function _setMargins(PHPExcel_Worksheet $pSheet) {
  $htmlPage = '@page { ';
  $htmlBody = 'body { ';
  $left = PHPExcel_Shared_String::FormatNumber($pSheet
    ->getPageMargins()
    ->getLeft()) . 'in; ';
  $htmlPage .= 'left-margin: ' . $left;
  $htmlBody .= 'left-margin: ' . $left;
  $right = PHPExcel_Shared_String::FormatNumber($pSheet
    ->getPageMargins()
    ->getRight()) . 'in; ';
  $htmlPage .= 'right-margin: ' . $right;
  $htmlBody .= 'right-margin: ' . $right;
  $top = PHPExcel_Shared_String::FormatNumber($pSheet
    ->getPageMargins()
    ->getTop()) . 'in; ';
  $htmlPage .= 'top-margin: ' . $top;
  $htmlBody .= 'top-margin: ' . $top;
  $bottom = PHPExcel_Shared_String::FormatNumber($pSheet
    ->getPageMargins()
    ->getBottom()) . 'in; ';
  $htmlPage .= 'bottom-margin: ' . $bottom;
  $htmlBody .= 'bottom-margin: ' . $bottom;
  $htmlPage .= "}\n";
  $htmlBody .= "}\n";
  return "<style>\n" . $htmlPage . $htmlBody . "</style>\n";
}