Documentation

Grid
in package

Pdf HTML table grid class

Walks a

DOM node into an explicit [row][col] grid, handling colspan/rowspan slot-claiming and header-row detection (, or a

whose cells are all
).
Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
6.0.0

Table of Contents

Properties

$columnCount  : int
Total column count across the whole table
$rowCount  : int
Total row count
$rows  : array<string|int, mixed>
Rows, keyed by zero-based row index: ['cells' => Cell[], 'isHeader' => bool]

Methods

build()  : Grid
Build a grid from a <table> DOM node
getColumnCount()  : int
Get the total column count
getRowCount()  : int
Get the total row count
getRows()  : array<string|int, mixed>
Get the rows
collectRowNodes()  : array<string|int, mixed>
Collect every <tr> node in document order, alongside whether it's inside a <thead>
parse()  : void
Parse the <table> DOM node into the grid

Properties

$columnCount

Total column count across the whole table

protected int $columnCount = 0

$rowCount

Total row count

protected int $rowCount = 0

$rows

Rows, keyed by zero-based row index: ['cells' => Cell[], 'isHeader' => bool]

protected array<string|int, mixed> $rows = []

Methods

build()

Build a grid from a <table> DOM node

public static build(Child $tableNode) : Grid
Parameters
$tableNode : Child
Return values
Grid

getColumnCount()

Get the total column count

public getColumnCount() : int
Return values
int

getRowCount()

Get the total row count

public getRowCount() : int
Return values
int

getRows()

Get the rows

public getRows() : array<string|int, mixed>
Return values
array<string|int, mixed>

collectRowNodes()

Collect every <tr> node in document order, alongside whether it's inside a <thead>

protected static collectRowNodes(Child $tableNode) : array<string|int, mixed>
Parameters
$tableNode : Child
Return values
array<string|int, mixed>

parse()

Parse the <table> DOM node into the grid

protected parse(Child $tableNode) : void
Parameters
$tableNode : Child

        
On this page

Search results