htmlResponsiveTable
extends htmlElement
in package
Responsive table.
Tags
Table of Contents
- ALIGN_BOTTOM = 3
- align to bottom
- ALIGN_CENTER = 4
- align to center
- ALIGN_LEFT = 1
- align to left
- ALIGN_RIGHT = 2
- align to right
- ALIGN_TOP = 0
- align to top
- $alignment : mixed
- alignment when inside a table
- $colspan : mixed
- colspan if inside a table
- $rowspan : mixed
- rowspan if inside a table
- $cssClasses : mixed
- CSS classes
- $tableCellCssClasses : mixed
- table cell CSS classes
- $accessibilityLabel : string|null
- accessibility label
- $cssEvenRow : mixed
- CSS class for even row numbers
- $cssOddRow : mixed
- CSS class for odd row numbers
- $data : mixed
- htmlElement[][] data rows
- $dataAttributes : mixed
- data attributes
- $highlighted : mixed
- highlighted rows
- $onClick : mixed
- onclick code (row number => code)
- $onDoubleClick : mixed
- ondoubleclick code (row number => code)
- $titles : array<string|int, string>
- $widths : mixed
- widthes of the columns
- __construct() : mixed
- Creates the table.
- addDataAttribute() : mixed
- Adds a data attribute.
- generateHTML() : array<string|int, mixed>
- Prints the HTML code for this element.
- getAccessibilityMarkup() : string
- Returns the markup for the accessibility data.
- getAlignmentString() : string
- Returns the HTML attributes for the alignment.
- getColspanString() : string
- Returns the HTML attribute for the colspan.
- getCSSClasses() : array<string|int, mixed>
- Returns the CSS classes of this element.
- getRowspanString() : string
- Returns the HTML attribute for the rowspan.
- getTableCellCSSClasses() : array<string|int, mixed>
- Returns the CSS classes of the surrounding table cell for this element.
- setAccessibilityLabel() : void
- Sets the accessibility label.
- setCSSClasses() : mixed
- Adds CSS classes to this element.
- setOnClickEvents() : mixed
- Sets the onclick code for the rows.
- setOnDoubleClickEvents() : mixed
- Sets the ondoubleclick code for the rows.
- setRowClasses() : mixed
- Sets the CSS classes for odd and even rows.
- setTableCellCSSClasses() : mixed
- Adds CSS classes to the surrounding table cell for this element.
- setWidths() : mixed
- Sets the width of each column.
- getDataAttributesAsString() : string
- Returns the data attributes as rendered string.
Constants
ALIGN_BOTTOM
align to bottom
public
mixed
ALIGN_BOTTOM
= 3
ALIGN_CENTER
align to center
public
mixed
ALIGN_CENTER
= 4
ALIGN_LEFT
align to left
public
mixed
ALIGN_LEFT
= 1
ALIGN_RIGHT
align to right
public
mixed
ALIGN_RIGHT
= 2
ALIGN_TOP
align to top
public
mixed
ALIGN_TOP
= 0
Properties
$alignment
alignment when inside a table
public
mixed
$alignment
$colspan
colspan if inside a table
public
mixed
$colspan
$rowspan
rowspan if inside a table
public
mixed
$rowspan
$cssClasses
CSS classes
protected
mixed
$cssClasses
= []
$tableCellCssClasses
table cell CSS classes
protected
mixed
$tableCellCssClasses
= []
$accessibilityLabel
accessibility label
private
string|null
$accessibilityLabel
= \null
$cssEvenRow
CSS class for even row numbers
private
mixed
$cssEvenRow
$cssOddRow
CSS class for odd row numbers
private
mixed
$cssOddRow
$data
htmlElement[][] data rows
private
mixed
$data
$dataAttributes
data attributes
private
mixed
$dataAttributes
= []
$highlighted
highlighted rows
private
mixed
$highlighted
= []
$onClick
onclick code (row number => code)
private
mixed
$onClick
= []
$onDoubleClick
ondoubleclick code (row number => code)
private
mixed
$onDoubleClick
= []
$titles
private
array<string|int, string>
$titles
row titles
$widths
widthes of the columns
private
mixed
$widths
= []
Methods
__construct()
Creates the table.
public
__construct(array<string|int, string> $titles, array<string|int, array<string|int, htmlElement>> $data[, array<string|int, int> $highlighted = null ]) : mixed
Parameters
- $titles : array<string|int, string>
-
row titles
- $data : array<string|int, array<string|int, htmlElement>>
-
data rows
- $highlighted : array<string|int, int> = null
-
list of row numbers that should be highlighted (starting at 0)
Return values
mixed —addDataAttribute()
Adds a data attribute.
public
addDataAttribute(string $key, string $value) : mixed
Parameters
- $key : string
-
attribute name (without "data-")
- $value : string
-
attribute value
Return values
mixed —generateHTML()
Prints the HTML code for this element.
public
generateHTML(mixed $module, mixed $input, mixed $values, mixed $restricted, mixed $scope) : array<string|int, mixed>
Parameters
- $module : mixed
-
Name of account module
- $input : mixed
-
List of meta-HTML elements
- $values : mixed
-
List of values which override the defaults in $input (name => value)
- $restricted : mixed
-
If true then no buttons will be displayed
- $scope : mixed
-
Account type
Tags
Return values
array<string|int, mixed> —List of input field names and their type (name => type)
getAccessibilityMarkup()
Returns the markup for the accessibility data.
public
getAccessibilityMarkup() : string
Return values
string —markup to be included in HTML tag (starting with space)
getAlignmentString()
Returns the HTML attributes for the alignment.
public
getAlignmentString() : string
Return values
string —alignment HTML attributes (e.g. align="right" valign="top")
getColspanString()
Returns the HTML attribute for the colspan.
public
getColspanString() : string
Return values
string —colspan HTML attribute (e.g. colspan=3)
getCSSClasses()
Returns the CSS classes of this element.
public
getCSSClasses() : array<string|int, mixed>
Return values
array<string|int, mixed> —$classes CSS class names
getRowspanString()
Returns the HTML attribute for the rowspan.
public
getRowspanString() : string
Return values
string —rowspan HTML attribute (e.g. rowspan=3)
getTableCellCSSClasses()
Returns the CSS classes of the surrounding table cell for this element.
public
getTableCellCSSClasses() : array<string|int, mixed>
Return values
array<string|int, mixed> —CSS classes
setAccessibilityLabel()
Sets the accessibility label.
public
setAccessibilityLabel(string|null $accessibilityLabel) : void
Parameters
- $accessibilityLabel : string|null
-
label
Return values
void —setCSSClasses()
Adds CSS classes to this element.
public
setCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
- $classes : array<string|int, mixed>
-
CSS class names
Return values
mixed —setOnClickEvents()
Sets the onclick code for the rows.
public
setOnClickEvents(array<string|int, mixed> $calls) : mixed
Parameters
- $calls : array<string|int, mixed>
-
row number => code
Return values
mixed —setOnDoubleClickEvents()
Sets the ondoubleclick code for the rows.
public
setOnDoubleClickEvents(array<string|int, mixed> $calls) : mixed
Parameters
- $calls : array<string|int, mixed>
-
row number => code
Return values
mixed —setRowClasses()
Sets the CSS classes for odd and even rows.
public
setRowClasses(string $oddClass, string $evenClass) : mixed
The title row counts as row number -1.
Parameters
- $oddClass : string
-
class for odd rows
- $evenClass : string
-
class for even rows
Return values
mixed —setTableCellCSSClasses()
Adds CSS classes to the surrounding table cell for this element.
public
setTableCellCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
- $classes : array<string|int, mixed>
-
CSS class names
Return values
mixed —setWidths()
Sets the width of each column.
public
setWidths(array<string|int, string> $widths) : mixed
Parameters
- $widths : array<string|int, string>
-
widths
Return values
mixed —getDataAttributesAsString()
Returns the data attributes as rendered string.
protected
getDataAttributesAsString() : string
Return values
string —data attributes