Documentation

Html extends BaseWriter
in package

Table of Contents

Constants

BODY_LINE  = ' <body>' . PHP_EOL
BORDER_ARR  = [\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE => self::BORDER_NONE, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT => '1px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT => '1px dotted', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED => '1px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED => '1px dotted', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE => '3px double', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR => '1px solid', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM => '2px solid', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT => '2px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT => '2px dotted', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT => '2px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK => '3px solid']
BORDER_NONE  = 'none'
COMMENT_HTML_TAGS_PLAINTEXT  = true
Migration aid to tell if html tags will be treated as plaintext in comments.
CUSTOM_TO_META  = [\PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN => 'bool', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE => 'date', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT => 'float', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER => 'int', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING => 'string']
DEFAULT_CELL_WIDTH_PIXELS  = 56
DEFAULT_CELL_WIDTH_POINTS  = 42

Properties

$embedImages  : bool
embed images, or link to images.
$fileHandle  : resource
$includeCharts  : bool
Write charts that are defined in the workbook? Identifies whether the Writer should write definitions for any charts that exist in the PhpSpreadsheet object.
$isMPdf  : bool
Is the current writer creating mPDF?
$isPdf  : bool
Is the current writer creating PDF?
$preCalculateFormulas  : bool
Pre-calculate formulas Forces PhpSpreadsheet to recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file.
$spreadsheet  : Spreadsheet
Spreadsheet object.
$columnWidths  : array<string|int, mixed>
Array of column widths in points.
$cssStyles  : array<string|int, mixed>|null
Array of CSS styles.
$defaultFont  : Font
Default font.
$diskCachingDirectory  : string
Disk caching directory.
$editHtmlCallback  : null|callable
Callback for editing generated html.
$generateSheetNavigationBlock  : bool
Generate the Navigation block.
$imagesRoot  : string
Images root.
$isBaseCell  : array<string|int, mixed>
Excel cells that are upper-left corner in a cell merge.
$isSpannedCell  : array<string|int, mixed>
Excel cells that should not be written as HTML cells.
$isSpannedRow  : array<string|int, mixed>
Excel rows that should not be written as HTML rows.
$sheetCharts  : array<string|int, Chart>
$sheetDrawings  : array<string|int, BaseDrawing>
$sheetIndex  : int|null
Sheet index to write.
$shouldCloseFile  : bool
$spansAreCalculated  : bool
Flag whether spans have been calculated.
$useDiskCaching  : bool
Use disk caching where possible?
$useInlineCss  : bool
Use inline CSS?

Methods

__construct()  : mixed
Create a new HTML.
buildCSS()  : array<string|int, mixed>
Build CSS styles.
formatColor()  : string
Add color to formatted string as inline style.
generateHtmlAll()  : string
Save Spreadsheet as html to variable.
generateHTMLFooter()  : string
Generate HTML footer.
generateHTMLHeader()  : string
Generate HTML header.
generateNavigation()  : string
Generate sheet tabs.
generateSheetData()  : string
Generate sheet data.
generateStyles()  : string
Generate CSS styles.
getDiskCachingDirectory()  : string
Get disk caching directory.
getEmbedImages()  : bool
Get embed images.
getGenerateSheetNavigationBlock()  : bool
Get sheet index.
getImagesRoot()  : string
Get images root.
getIncludeCharts()  : bool
Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object.
getOrientation()  : string|null
getPreCalculateFormulas()  : bool
Get Pre-Calculate Formulas flag If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.
getSheetIndex()  : int|null
Get sheet index.
getUseDiskCaching()  : bool
Get use disk caching where possible?
getUseInlineCss()  : bool
Get use inline CSS?
openFileHandle()  : void
Open file handle.
save()  : void
Save Spreadsheet to file.
setEditHtmlCallback()  : void
Set a callback to edit the entire HTML.
setEmbedImages()  : $this
Set embed images.
setGenerateSheetNavigationBlock()  : $this
Set sheet index.
setImagesRoot()  : $this
Set images root.
setIncludeCharts()  : $this
Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.
setPreCalculateFormulas()  : $this
Set Pre-Calculate Formulas Set to true (the default) to advise the Writer to calculate all formulae on save Set to false to prevent precalculation of formulae on save.
setSheetIndex()  : $this
Set sheet index.
setUseDiskCaching()  : $this
Set use disk caching where possible?
setUseInlineCss()  : $this
Set use inline CSS?
winFileToUrl()  : string
Convert Windows file name to file protocol URL.
writeAllSheets()  : $this
Write all sheets (resets sheetIndex to NULL).
maybeCloseFileHandle()  : void
Close file handle only if we opened it ourselves.
processFlags()  : void
adjustRendererPositions()  : void
assembleCSS()  : string
Takes array where of CSS properties / values and converts to CSS string.
buildCssPerSheet()  : void
buildCssRowHeights()  : void
calculateSpans()  : void
Calculate information about HTML colspan and rowspan which is not always the same as Excel's.
calculateSpansOmitRows()  : void
createCSSStyle()  : array<string|int, mixed>
Create CSS style.
createCSSStyleAlignment()  : array<string|int, mixed>
Create CSS style.
createCSSStyleBorder()  : string
Create CSS style.
createCSSStyleBorders()  : array<string|int, mixed>
Create CSS style.
createCSSStyleFill()  : array<string|int, mixed>
Create CSS style (Fill).
createCSSStyleFont()  : array<string|int, mixed>
Create CSS style.
extendRowsAndColumns()  : void
generateMeta()  : string
generatePageDeclarations()  : string
Generate @page declarations.
generateRow()  : string
Generate row.
generateRowCellCss()  : array<string|int, mixed>
generateRowCellData()  : string
generateRowCellDataValue()  : void
generateRowCellDataValueRich()  : string
generateRowIncludeCharts()  : string
generateRowSpans()  : string
generateRowStart()  : string
Generate row start.
generateRowWriteCell()  : void
generateSheetPrep()  : array<string|int, mixed>
generateSheetStarts()  : array<string|int, mixed>
generateSheetTags()  : array<string|int, mixed>
generateTableFooter()  : string
Generate table footer.
generateTableHeader()  : string
Generate table header.
generateTableTag()  : void
generateTableTagInline()  : string
mapBorderStyle()  : string
Map border style.
mapHAlign()  : string
Map HAlign.
mapVAlign()  : string
Map VAlign.
shouldGenerateColumn()  : bool
shouldGenerateRow()  : bool
writeChartInCell()  : string
Generate chart tag in cell.
writeComment()  : string
Write a comment in the same format as LibreOffice.
writeImageInCell()  : string
Generate image tag in cell.

Constants

BODY_LINE

public mixed BODY_LINE = ' <body>' . PHP_EOL

BORDER_ARR

public mixed BORDER_ARR = [\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE => self::BORDER_NONE, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT => '1px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT => '1px dotted', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED => '1px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED => '1px dotted', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE => '3px double', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR => '1px solid', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM => '2px solid', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT => '2px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT => '2px dotted', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT => '2px dashed', \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK => '3px solid']

BORDER_NONE

public mixed BORDER_NONE = 'none'

COMMENT_HTML_TAGS_PLAINTEXT

Migration aid to tell if html tags will be treated as plaintext in comments.

public mixed COMMENT_HTML_TAGS_PLAINTEXT = true

if ( defined( \PhpOffice\PhpSpreadsheet\Writer\Html::class . '::COMMENT_HTML_TAGS_PLAINTEXT' ) ) { new logic with styling in TextRun elements } else { old logic with styling via Html tags }.

CUSTOM_TO_META

private mixed CUSTOM_TO_META = [\PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN => 'bool', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE => 'date', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT => 'float', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER => 'int', \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING => 'string']

DEFAULT_CELL_WIDTH_PIXELS

private mixed DEFAULT_CELL_WIDTH_PIXELS = 56

DEFAULT_CELL_WIDTH_POINTS

private mixed DEFAULT_CELL_WIDTH_POINTS = 42

Properties

$embedImages

embed images, or link to images.

protected bool $embedImages = false

$includeCharts

Write charts that are defined in the workbook? Identifies whether the Writer should write definitions for any charts that exist in the PhpSpreadsheet object.

protected bool $includeCharts = false

$isMPdf

Is the current writer creating mPDF?

protected bool $isMPdf = false
Tags
deprecated
2.0.1

use instanceof Mpdf instead

$isPdf

Is the current writer creating PDF?

protected bool $isPdf = false

$preCalculateFormulas

Pre-calculate formulas Forces PhpSpreadsheet to recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file.

protected bool $preCalculateFormulas = true

$columnWidths

Array of column widths in points.

private array<string|int, mixed> $columnWidths

$cssStyles

Array of CSS styles.

private array<string|int, mixed>|null $cssStyles = null

$defaultFont

Default font.

private Font $defaultFont

$diskCachingDirectory

Disk caching directory.

private string $diskCachingDirectory = './'

$editHtmlCallback

Callback for editing generated html.

private null|callable $editHtmlCallback

$generateSheetNavigationBlock

Generate the Navigation block.

private bool $generateSheetNavigationBlock = true

$imagesRoot

Images root.

private string $imagesRoot = ''

$isBaseCell

Excel cells that are upper-left corner in a cell merge.

private array<string|int, mixed> $isBaseCell = []

$isSpannedCell

Excel cells that should not be written as HTML cells.

private array<string|int, mixed> $isSpannedCell = []

$isSpannedRow

Excel rows that should not be written as HTML rows.

private array<string|int, mixed> $isSpannedRow = []

$sheetCharts

private array<string|int, Chart> $sheetCharts

$sheetIndex

Sheet index to write.

private int|null $sheetIndex = 0

$spansAreCalculated

Flag whether spans have been calculated.

private bool $spansAreCalculated = false

$useDiskCaching

Use disk caching where possible?

private bool $useDiskCaching = false

$useInlineCss

Use inline CSS?

private bool $useInlineCss = false

Methods

__construct()

Create a new HTML.

public __construct(Spreadsheet $spreadsheet) : mixed
Parameters
$spreadsheet : Spreadsheet

The spreadsheet that we want to save using this Writer

buildCSS()

Build CSS styles.

public buildCSS([bool $generateSurroundingHTML = true ]) : array<string|int, mixed>
Parameters
$generateSurroundingHTML : bool = true

Generate surrounding HTML style? (html { })

Return values
array<string|int, mixed>

formatColor()

Add color to formatted string as inline style.

public formatColor(string $value, string $format) : string
Parameters
$value : string

Plain formatted value without color

$format : string

Format code

Return values
string

generateHtmlAll()

Save Spreadsheet as html to variable.

public generateHtmlAll() : string
Return values
string

generateHTMLFooter()

Generate HTML footer.

public generateHTMLFooter() : string
Return values
string

generateHTMLHeader()

Generate HTML header.

public generateHTMLHeader([bool $includeStyles = false ]) : string
Parameters
$includeStyles : bool = false

Include styles?

Return values
string

generateNavigation()

Generate sheet tabs.

public generateNavigation() : string
Return values
string

generateSheetData()

Generate sheet data.

public generateSheetData() : string
Return values
string

generateStyles()

Generate CSS styles.

public generateStyles([bool $generateSurroundingHTML = true ]) : string
Parameters
$generateSurroundingHTML : bool = true

Generate surrounding HTML tags? (<style> and </style>)

Return values
string

getDiskCachingDirectory()

Get disk caching directory.

public getDiskCachingDirectory() : string
Return values
string

getEmbedImages()

Get embed images.

public getEmbedImages() : bool
Return values
bool

getGenerateSheetNavigationBlock()

Get sheet index.

public getGenerateSheetNavigationBlock() : bool
Return values
bool

getImagesRoot()

Get images root.

public getImagesRoot() : string
Return values
string

getIncludeCharts()

Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object.

public getIncludeCharts() : bool

If false (the default) it will ignore any charts defined in the PhpSpreadsheet object.

Return values
bool

getOrientation()

public getOrientation() : string|null
Return values
string|null

getPreCalculateFormulas()

Get Pre-Calculate Formulas flag If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.

public getPreCalculateFormulas() : bool
Return values
bool

getSheetIndex()

Get sheet index.

public getSheetIndex() : int|null
Return values
int|null

getUseDiskCaching()

Get use disk caching where possible?

public getUseDiskCaching() : bool
Return values
bool

getUseInlineCss()

Get use inline CSS?

public getUseInlineCss() : bool
Return values
bool

openFileHandle()

Open file handle.

public openFileHandle(resource|string $filename) : void
Parameters
$filename : resource|string

save()

Save Spreadsheet to file.

public save(resource|string $filename[, int $flags = 0 ]) : void
Parameters
$filename : resource|string
$flags : int = 0

Flags that can change the behaviour of the Writer: self::SAVE_WITH_CHARTS Save any charts that are defined (if the Writer supports Charts) self::DISABLE_PRECALCULATE_FORMULAE Don't Precalculate formulae before saving the file

setEditHtmlCallback()

Set a callback to edit the entire HTML.

public setEditHtmlCallback(callable|null $callback) : void

The callback must accept the HTML as string as first parameter, and it must return the edited HTML as string.

Parameters
$callback : callable|null

setEmbedImages()

Set embed images.

public setEmbedImages(bool $embedImages) : $this
Parameters
$embedImages : bool
Return values
$this

setGenerateSheetNavigationBlock()

Set sheet index.

public setGenerateSheetNavigationBlock(bool $generateSheetNavigationBlock) : $this
Parameters
$generateSheetNavigationBlock : bool

Flag indicating whether the sheet navigation block should be generated or not

Return values
$this

setImagesRoot()

Set images root.

public setImagesRoot(string $imagesRoot) : $this
Parameters
$imagesRoot : string
Return values
$this

setIncludeCharts()

Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.

public setIncludeCharts(bool $includeCharts) : $this

Set to false (the default) to ignore charts.

Parameters
$includeCharts : bool
Return values
$this

setPreCalculateFormulas()

Set Pre-Calculate Formulas Set to true (the default) to advise the Writer to calculate all formulae on save Set to false to prevent precalculation of formulae on save.

public setPreCalculateFormulas(bool $precalculateFormulas) : $this
Parameters
$precalculateFormulas : bool

Pre-Calculate Formulas?

Return values
$this

setSheetIndex()

Set sheet index.

public setSheetIndex(int $sheetIndex) : $this
Parameters
$sheetIndex : int

Sheet index

Return values
$this

setUseDiskCaching()

Set use disk caching where possible?

public setUseDiskCaching(bool $useDiskCache[, string|null $cacheDirectory = null ]) : $this
Parameters
$useDiskCache : bool
$cacheDirectory : string|null = null

Disk caching directory

Return values
$this

setUseInlineCss()

Set use inline CSS?

public setUseInlineCss(bool $useInlineCss) : $this
Parameters
$useInlineCss : bool
Return values
$this

winFileToUrl()

Convert Windows file name to file protocol URL.

public static winFileToUrl(string $filename[, bool $mpdf = false ]) : string
Parameters
$filename : string

file name on local system

$mpdf : bool = false
Return values
string

writeAllSheets()

Write all sheets (resets sheetIndex to NULL).

public writeAllSheets() : $this
Return values
$this

maybeCloseFileHandle()

Close file handle only if we opened it ourselves.

protected maybeCloseFileHandle() : void

processFlags()

protected processFlags(int $flags) : void
Parameters
$flags : int

assembleCSS()

Takes array where of CSS properties / values and converts to CSS string.

private assembleCSS([array<string|int, mixed> $values = [] ]) : string
Parameters
$values : array<string|int, mixed> = []
Return values
string

buildCssPerSheet()

private buildCssPerSheet(Worksheet $sheet, array<string|int, mixed> &$css) : void
Parameters
$sheet : Worksheet
$css : array<string|int, mixed>

buildCssRowHeights()

private buildCssRowHeights(Worksheet $sheet, array<string|int, mixed> &$css, int $sheetIndex) : void
Parameters
$sheet : Worksheet
$css : array<string|int, mixed>
$sheetIndex : int

calculateSpans()

Calculate information about HTML colspan and rowspan which is not always the same as Excel's.

private calculateSpans() : void

calculateSpansOmitRows()

private calculateSpansOmitRows(Worksheet $sheet, int $sheetIndex, array<string|int, mixed> $candidateSpannedRow) : void
Parameters
$sheet : Worksheet
$sheetIndex : int
$candidateSpannedRow : array<string|int, mixed>

createCSSStyle()

Create CSS style.

private createCSSStyle(Style $style) : array<string|int, mixed>
Parameters
$style : Style
Return values
array<string|int, mixed>

createCSSStyleAlignment()

Create CSS style.

private createCSSStyleAlignment(Alignment $alignment) : array<string|int, mixed>
Parameters
$alignment : Alignment
Return values
array<string|int, mixed>

createCSSStyleBorder()

Create CSS style.

private createCSSStyleBorder(Border $border) : string
Parameters
$border : Border

Border

Return values
string

createCSSStyleBorders()

Create CSS style.

private createCSSStyleBorders(Borders $borders) : array<string|int, mixed>
Parameters
$borders : Borders

Borders

Return values
array<string|int, mixed>

createCSSStyleFill()

Create CSS style (Fill).

private createCSSStyleFill(Fill $fill) : array<string|int, mixed>
Parameters
$fill : Fill

Fill

Return values
array<string|int, mixed>

createCSSStyleFont()

Create CSS style.

private createCSSStyleFont(Font $font) : array<string|int, mixed>
Parameters
$font : Font
Return values
array<string|int, mixed>

extendRowsAndColumns()

private extendRowsAndColumns(Worksheet $worksheet, int &$colMax, int &$rowMax) : void
Parameters
$worksheet : Worksheet
$colMax : int
$rowMax : int

generateMeta()

private static generateMeta(string|null $val, string $desc) : string
Parameters
$val : string|null
$desc : string
Return values
string

generatePageDeclarations()

Generate @page declarations.

private generatePageDeclarations(bool $generateSurroundingHTML) : string
Parameters
$generateSurroundingHTML : bool
Return values
string

generateRow()

Generate row.

private generateRow(Worksheet $worksheet, array<string|int, mixed> $values, int $row, string $cellType) : string
Parameters
$worksheet : Worksheet
$values : array<string|int, mixed>

Array containing cells in a row

$row : int

Row number (0-based)

$cellType : string

eg: 'td'

Return values
string

generateRowCellCss()

private generateRowCellCss(Worksheet $worksheet, string $cellAddress, int $row, int $columnNumber) : array<string|int, mixed>
Parameters
$worksheet : Worksheet
$cellAddress : string
$row : int
$columnNumber : int
Return values
array<string|int, mixed>

generateRowCellData()

private generateRowCellData(Worksheet $worksheet, null|Cell|string $cell, array<string|int, mixed>|string &$cssClass) : string
Parameters
$worksheet : Worksheet
$cell : null|Cell|string
$cssClass : array<string|int, mixed>|string
Return values
string

generateRowCellDataValue()

private generateRowCellDataValue(Worksheet $worksheet, Cell $cell, string &$cellData) : void
Parameters
$worksheet : Worksheet
$cell : Cell
$cellData : string

generateRowCellDataValueRich()

private generateRowCellDataValueRich(RichText $richText) : string
Parameters
$richText : RichText
Return values
string

generateRowIncludeCharts()

private generateRowIncludeCharts(Worksheet $worksheet, string $coordinate) : string
Parameters
$worksheet : Worksheet
$coordinate : string
Return values
string

generateRowSpans()

private generateRowSpans(string $html, int $rowSpan, int $colSpan) : string
Parameters
$html : string
$rowSpan : int
$colSpan : int
Return values
string

generateRowStart()

Generate row start.

private generateRowStart(Worksheet $worksheet, int $sheetIndex, int $row) : string
Parameters
$worksheet : Worksheet
$sheetIndex : int

Sheet index (0-based)

$row : int

row number

Return values
string

generateRowWriteCell()

private generateRowWriteCell(string &$html, Worksheet $worksheet, string $coordinate, string $cellType, string $cellData, int $colSpan, int $rowSpan, array<string|int, mixed>|string $cssClass, int $colNum, int $sheetIndex, int $row) : void
Parameters
$html : string
$worksheet : Worksheet
$coordinate : string
$cellType : string
$cellData : string
$colSpan : int
$rowSpan : int
$cssClass : array<string|int, mixed>|string
$colNum : int
$sheetIndex : int
$row : int

generateSheetPrep()

private generateSheetPrep() : array<string|int, mixed>
Return values
array<string|int, mixed>

generateSheetStarts()

private generateSheetStarts(Worksheet $sheet, int $rowMin) : array<string|int, mixed>
Parameters
$sheet : Worksheet
$rowMin : int
Return values
array<string|int, mixed>

generateSheetTags()

private generateSheetTags(int $row, int $theadStart, int $theadEnd, int $tbodyStart) : array<string|int, mixed>
Parameters
$row : int
$theadStart : int
$theadEnd : int
$tbodyStart : int
Return values
array<string|int, mixed>

generateTableFooter()

Generate table footer.

private generateTableFooter() : string
Return values
string

generateTableHeader()

Generate table header.

private generateTableHeader(Worksheet $worksheet[, bool $showid = true ]) : string
Parameters
$worksheet : Worksheet

The worksheet for the table we are writing

$showid : bool = true

whether or not to add id to table tag

Return values
string

generateTableTag()

private generateTableTag(Worksheet $worksheet, string $id, string &$html, int $sheetIndex) : void
Parameters
$worksheet : Worksheet
$id : string
$html : string
$sheetIndex : int

generateTableTagInline()

private generateTableTagInline(Worksheet $worksheet, string $id) : string
Parameters
$worksheet : Worksheet
$id : string
Return values
string

mapBorderStyle()

Map border style.

private mapBorderStyle(int|string $borderStyle) : string
Parameters
$borderStyle : int|string

Sheet index

Return values
string

mapHAlign()

Map HAlign.

private mapHAlign(string $hAlign) : string
Parameters
$hAlign : string

Horizontal alignment

Return values
string

mapVAlign()

Map VAlign.

private mapVAlign(string $vAlign) : string
Parameters
$vAlign : string

Vertical alignment

Return values
string

shouldGenerateColumn()

private shouldGenerateColumn(Worksheet $sheet, string $colStr) : bool
Parameters
$sheet : Worksheet
$colStr : string
Return values
bool

shouldGenerateRow()

private shouldGenerateRow(Worksheet $sheet, int $row) : bool
Parameters
$sheet : Worksheet
$row : int
Return values
bool

writeChartInCell()

Generate chart tag in cell.

private writeChartInCell(Worksheet $worksheet, string $coordinates) : string

This code should be exercised by sample: Chart/32_Chart_read_write_PDF.php.

Parameters
$worksheet : Worksheet
$coordinates : string
Return values
string

writeImageInCell()

Generate image tag in cell.

private writeImageInCell(string $coordinates) : string
Parameters
$coordinates : string

Cell coordinates

Return values
string

        
On this page

Search results