Since: PHPLucidFrame v 1.12.0

class ConsoleTable

This file is part of the PHPLucidFrame library.

The class makes you easy to build console style tables

Constants

HEADER_INDEX

HR

Properties

protected array $data

Array of table data

protected bool $border

Border shown or not

protected bool $allBorders

All borders shown or not

protected int $padding

Table padding

protected int $indent

Table left margin

Methods

headers(array $content)

Set headers for the columns in one-line

rows(array $rows)

No description

getHeaders()

Get the row of header

showBorder()

Show table border

hideBorder()

Hide table border

showAllBorders()

Show all table borders

setPadding(int $value = 1)

Set padding for each cell

setIndent(int $value = 0)

Set left indentation for the table

addBorderLine()

Add horizontal border line

void
display()

Print the table

Details

at line 71
ConsoleTable headers(array $content)

Set headers for the columns in one-line

Parameters

array $content

Array of header cell content

Return Value

ConsoleTable

at line 79
ConsoleTable rows(array $rows)

No description

Parameters

array $rows

Return Value

ConsoleTable

at line 90
getHeaders()

Get the row of header

at line 99
ConsoleTable showBorder()

Show table border

Return Value

ConsoleTable

at line 110
ConsoleTable hideBorder()

Hide table border

Return Value

ConsoleTable

at line 121
ConsoleTable showAllBorders()

Show all table borders

Return Value

ConsoleTable

at line 134
ConsoleTable setPadding(int $value = 1)

Set padding for each cell

Parameters

int $value

The integer value, defaults to 1

Return Value

ConsoleTable

at line 146
ConsoleTable setIndent(int $value = 0)

Set left indentation for the table

Parameters

int $value

The integer value, defaults to 1

Return Value

ConsoleTable

at line 157
ConsoleTable addBorderLine()

Add horizontal border line

Return Value

ConsoleTable

at line 169
void display()

Print the table

Return Value

void