Cellmap
in package
Maps table cells to the table grid.
This class resolves borders in tables with collapsed borders and helps place row & column spanned table cells.
Table of Contents
- $_BORDER_STYLE_SCORE : array<string|int, mixed>
- Border style weight lookup for collapsed border resolution.
- $_borders : array<string|int, mixed>
- 2D array of border specs
- $_cells : array<string|int, array<string|int, Frame>>
- 2D array mapping <row,column> to frames
- $_columns : array<string|int, mixed>
- 1D array of column dimensions
- $_frames : array<string|int, Frame>
- 1D Array mapping frames to (multiple) <row, col> pairs, keyed on frame_id.
- $_num_cols : int
- The total number of columns in the table
- $_num_rows : int
- The total number of rows in the table
- $_rows : array<string|int, mixed>
- 1D array of row dimensions
- $_table : Table
- The table object this cellmap is attached to.
- $__col : int
- Current column when adding cells, 0-based
- $__row : int
- Current row when adding cells, 0-based
- $_columns_locked : bool
- Tells whether the columns' width can be modified
- $_fixed_layout : bool
- Tells whether the table has table-layout:fixed
- __construct() : mixed
- __toString() : string
- Used for debugging:
- add_frame() : mixed
- add_row() : mixed
- assign_frame_heights() : mixed
- assign_x_positions() : mixed
- frame_exists_in_cellmap() : bool
- get_border() : mixed
- get_border_properties() : array<string|int, mixed>
- get_column() : mixed
- get_columns() : array<string|int, mixed>
- get_frame_height() : int
- get_frame_position() : array<string|int, mixed>
- get_frame_width() : int
- get_num_cols() : int
- get_num_rows() : int
- get_row() : mixed
- get_rows() : array<string|int, mixed>
- get_spanned_cells() : null|Frame
- is_columns_locked() : bool
- is_layout_fixed() : bool
- lock_columns() : mixed
- remove_row() : mixed
- Remove a row from the cellmap.
- remove_row_group() : mixed
- Remove a row group from the cellmap.
- reset() : mixed
- set_column_width() : mixed
- set_columns() : mixed
- set_frame_heights() : mixed
- Re-adjust frame height if the table height is larger than its content
- set_layout_fixed() : mixed
- set_row_height() : mixed
- update_row_group() : mixed
- Update a row group after rows have been removed
- _resolve_border() : mixed
Properties
$_BORDER_STYLE_SCORE
Border style weight lookup for collapsed border resolution.
protected
static array<string|int, mixed>
$_BORDER_STYLE_SCORE
= ["inset" => 1, "groove" => 2, "outset" => 3, "ridge" => 4, "dotted" => 5, "dashed" => 6, "solid" => 7, "double" => 8, "hidden" => 9, "none" => 0]
$_borders
2D array of border specs
protected
array<string|int, mixed>
$_borders
$_cells
2D array mapping <row,column> to frames
protected
array<string|int, array<string|int, Frame>>
$_cells
$_columns
1D array of column dimensions
protected
array<string|int, mixed>
$_columns
$_frames
1D Array mapping frames to (multiple) <row, col> pairs, keyed on frame_id.
protected
array<string|int, Frame>
$_frames
$_num_cols
The total number of columns in the table
protected
int
$_num_cols
$_num_rows
The total number of rows in the table
protected
int
$_num_rows
$_rows
1D array of row dimensions
protected
array<string|int, mixed>
$_rows
$_table
The table object this cellmap is attached to.
protected
Table
$_table
$__col
Current column when adding cells, 0-based
private
int
$__col
$__row
Current row when adding cells, 0-based
private
int
$__row
$_columns_locked
Tells whether the columns' width can be modified
private
bool
$_columns_locked
= false
$_fixed_layout
Tells whether the table has table-layout:fixed
private
bool
$_fixed_layout
= false
Methods
__construct()
public
__construct(Table $table) : mixed
Parameters
- $table : Table
Return values
mixed —__toString()
Used for debugging:
public
__toString() : string
Return values
string —add_frame()
public
add_frame(Frame $frame) : mixed
Parameters
- $frame : Frame
Return values
mixed —add_row()
public
add_row() : mixed
Return values
mixed —assign_frame_heights()
public
assign_frame_heights() : mixed
Return values
mixed —assign_x_positions()
public
assign_x_positions() : mixed
Return values
mixed —frame_exists_in_cellmap()
public
frame_exists_in_cellmap(Frame $frame) : bool
Parameters
- $frame : Frame
Return values
bool —get_border()
public
get_border(int $i, int $j, mixed $h_v[, null|mixed $prop = null ]) : mixed
Parameters
- $i : int
- $j : int
- $h_v : mixed
- $prop : null|mixed = null
Return values
mixed —get_border_properties()
public
get_border_properties(int $i, int $j) : array<string|int, mixed>
Parameters
- $i : int
- $j : int
Return values
array<string|int, mixed> —get_column()
public
get_column(int $i) : mixed
Parameters
- $i : int
Return values
mixed —get_columns()
public
get_columns() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_frame_height()
public
get_frame_height(Frame $frame) : int
Parameters
- $frame : Frame
Tags
Return values
int —get_frame_position()
public
get_frame_position(Frame $frame) : array<string|int, mixed>
Parameters
- $frame : Frame
Tags
Return values
array<string|int, mixed> —get_frame_width()
public
get_frame_width(Frame $frame) : int
Parameters
- $frame : Frame
Tags
Return values
int —get_num_cols()
public
get_num_cols() : int
Return values
int —get_num_rows()
public
get_num_rows() : int
Return values
int —get_row()
public
get_row(int $j) : mixed
Parameters
- $j : int
Return values
mixed —get_rows()
public
get_rows() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_spanned_cells()
public
get_spanned_cells(Frame $frame) : null|Frame
Parameters
- $frame : Frame
Return values
null|Frame —is_columns_locked()
public
is_columns_locked() : bool
Return values
bool —is_layout_fixed()
public
is_layout_fixed() : bool
Return values
bool —lock_columns()
public
lock_columns() : mixed
Return values
mixed —remove_row()
Remove a row from the cellmap.
public
remove_row(Frame $row) : mixed
Parameters
- $row : Frame
Return values
mixed —remove_row_group()
Remove a row group from the cellmap.
public
remove_row_group(Frame $group) : mixed
Parameters
- $group : Frame
-
The group to remove
Return values
mixed —reset()
public
reset() : mixed
Return values
mixed —set_column_width()
public
set_column_width(int $j, mixed $width) : mixed
Parameters
- $j : int
- $width : mixed
Return values
mixed —set_columns()
public
set_columns( $columns) : mixed
Parameters
Return values
mixed —set_frame_heights()
Re-adjust frame height if the table height is larger than its content
public
set_frame_heights(mixed $table_height, mixed $content_height) : mixed
Parameters
- $table_height : mixed
- $content_height : mixed
Return values
mixed —set_layout_fixed()
public
set_layout_fixed( $fixed) : mixed
Parameters
Return values
mixed —set_row_height()
public
set_row_height(int $i, mixed $height) : mixed
Parameters
- $i : int
- $height : mixed
Return values
mixed —update_row_group()
Update a row group after rows have been removed
public
update_row_group(Frame $group, Frame $last_row) : mixed
Parameters
Return values
mixed —_resolve_border()
protected
_resolve_border(int $i, int $j, mixed $h_v, mixed $border_spec) : mixed
Parameters
- $i : int
- $j : int
- $h_v : mixed
- $border_spec : mixed