TableStyle
in package
FinalYes
Styling for {@see Table} rendering. All fields have sensible defaults so `new TableStyle()` produces a readable table.
The body font / size are inherited from the surrounding Pdf
context (or from Theme for Writer\Page::drawTable()). To override
locally, pass a per-call style.
Table of Contents
Properties
- $borderColor : array<string|int, mixed>
- $borderWidth : float
- $cellAlignments : array<string|int, mixed>
- $cellPadding : float
- $headerBgColor : array<string|int, mixed>|null
- $headerBold : bool
Methods
- __construct() : mixed
- alignmentFor() : Alignment
Properties
$borderColor read-only
public
array<string|int, mixed>
$borderColor
= [0.7, 0.7, 0.7]
$borderWidth read-only
public
float
$borderWidth
= 0.5
$cellAlignments read-only
public
array<string|int, mixed>
$cellAlignments
= []
$cellPadding read-only
public
float
$cellPadding
= 4.0
$headerBgColor read-only
public
array<string|int, mixed>|null
$headerBgColor
= [0.93, 0.93, 0.93]
$headerBold read-only
public
bool
$headerBold
= true
Methods
__construct()
public
__construct([float $cellPadding = 4.0 ][, array{float, float, float} $borderColor = [0.7, 0.7, 0.7] ][, float $borderWidth = 0.5 ][, array{float, float, float}|null $headerBgColor = [0.93, 0.93, 0.93] ][, bool $headerBold = true ][, array<int, Alignment> $cellAlignments = [] ]) : mixed
Parameters
- $cellPadding : float = 4.0
-
Inside each cell, in points.
- $borderColor : array{float, float, float} = [0.7, 0.7, 0.7]
-
RGB 0-1; only used when
$borderWidth > 0. - $borderWidth : float = 0.5
-
0 disables borders entirely.
- $headerBgColor : array{float, float, float}|null = [0.93, 0.93, 0.93]
-
Header row fill; null = no header background.
- $headerBold : bool = true
-
Use the bold font variant for the header row.
- $cellAlignments : array<int, Alignment> = []
-
Per-column alignment; missing entries default to Left.
alignmentFor()
public
alignmentFor(int $columnIndex) : Alignment
Parameters
- $columnIndex : int