Constructor: TableElement

OpenAjax.a11y.cache.TableElement

new TableElement(dom_cache, dom_element, table_cell_element) → {TableElement}

Creates table element object used to hold data about a table

Parameters:
Name Type Description
dom_cache DOMCache Reference to the current dom cache for use of dom cache methods to find references
dom_element DOMElement dom_element object provides information about current dom node
table_cell_element TableCellElement table_cell_element object provides information about the table cell the table may be a child of in the dom
Properties:
Name Type Description
dom_cache DOMCache DOMCache reference for reference DOMCache methods for calculating headers
dom_element DOMElement DOMElement associated with the form element
cache_id String String that uniquely identifies the cache element object in the cache
document_order Number Ordinal position of the table element in the document in relationship to other table elements
child_cache_elements Array Array of cache table elements as part of table elements relationship tree
table_elements Array List of all table element objects in this table element object
length Number Number of table element objects
effective_summary String The calculated description of a data table, empty for layout tables
effective_caption String The calculated name of a data table, empty for layout tables
max_row Number Number of rows in a table
max_column Number Number of columns in a table
row Number Used as the current row counter when traversing a table dom elements
column Number Used as the current column counter when traversing a table dom elements
cells Array A two dimensional array representing the table row and columns
cell_ids Array List of table cell objects who have an id attribute defined
is_data_table Boolean True if the table is identified as a data table
is_complex_data_table Boolean True if the table is identified as a complex data table
Source:
  • scripts/cache_tables.js, line 498
Returns:
Type
TableElement

Methods

<static> addChild(table_element)

Adds a cache table element to the root tree representation of the tree cache

Parameters:
Name Type Description
table_element TableElement | CaptionElement | THeadElement | TBodyElement | TableRowElement | TableCellElement Cache table element object to add to root of tree of table elements
Source:
  • scripts/cache_tables.js, line 778

<static> addTableCellElement(table_cell_element)

Adds a TableCellElement to the current row

Parameters:
Name Type Description
table_cell_element TableCellElement The table cell element object to add in to the current row and column of a table
Source:
  • scripts/cache_tables.js, line 905

<static> addTableElement(table_element) → {Number}

Adds a table cache element object to table_elements array and generates a cache id value for the table element object

Parameters:
Name Type Description
table_element CaptionElement | TableTHeadElement | TableTBodyElement | TableRowElement | TableCellElement table cache element to add
Source:
  • scripts/cache_tables.js, line 691
Returns:
Returns the length the list of table elements
Type
Number

<static> findFirstColumnWithContent() → {Number}

Finds the first column of the table which has text content in at least one cell. This is used to skip columns that are used for stylistic puposes, since they usually do not have any text content other than spaces in them.

Source:
  • scripts/cache_tables.js, line 1105
Returns:
Returns number of first column with content
Type
Number

<static> findFirstRowWithContent() → {Number}

Finds the first row of the table which has text content in at least one cell. This is used to skip rows that are used for stylistic puposes, since they usually do not have any text content other than spaces in them.

Source:
  • scripts/cache_tables.js, line 1063
Returns:
Returns number of first row with content
Type
Number

<static> getAttributes() → {Array}

Returns an array of attributes for the element, sorted in alphabetical order

Source:
  • scripts/cache_tables.js, line 1266
Returns:
Returns a array of node results
Type
Array

<static> getCacheProperties() → {Array}

Returns an array of cache properties sorted by property name

Source:
  • scripts/cache_tables.js, line 1322
Returns:
Returns a array of cache properties
Type
Array

<static> getCachePropertyValue(property) → {String|Number}

Returns the value of a property

Parameters:
Name Type Description
property String The property to retreive the value
Source:
  • scripts/cache_tables.js, line 1351
Returns:
Returns the value of the property
Type
String | Number

<static> getEvents() → {Array}

Returns an array of events for the element, sorted in alphabetical order

Source:
  • scripts/cache_tables.js, line 1289
Returns:
Returns a array of event information
Type
Array

<static> getItemByCacheId(cache_id) → {CaptionElement|TheadElement|TBodyElement|TableRowElement|TableCellElement|null}

Retrieve table cache element from the tree of table cache elements

Parameters:
Name Type Description
cache_id String cache_id of a table cache element
Source:
  • scripts/cache_tables.js, line 650
Returns:
Returns table cache element if cahce id is found, otherwise null
Type
CaptionElement | TheadElement | TBodyElement | TableRowElement | TableCellElement | null

<static> getNodeResults() → {Array}

Returns an array of node results in severity order

Source:
  • scripts/cache_tables.js, line 1252
Returns:
Returns a array of node results
Type
Array

<static> getStyle() → {Array}

Returns an array of style items

Source:
  • scripts/cache_tables.js, line 1306
Returns:
Returns a array of style items
Type
Array

<static> getTableElementByCacheId(cache_id) → {CaptionElement|TheadElement|TBodyElement|TableRowElement|TableCellElement|null}

Retrieve table cache element from the tree of table cache elements

Parameters:
Name Type Description
cache_id String cache_id of a table cache element
Source:
  • scripts/cache_tables.js, line 635
Returns:
Returns table cache element if cahce id is found, otherwise null
Type
CaptionElement | TheadElement | TBodyElement | TableRowElement | TableCellElement | null

<static> headerCellsInFirstColumn() → {Object}

Calculates the number of non-empty cells in the first column with content and how many of the non-empty cells are header cells

Source:
  • scripts/cache_tables.js, line 1200
Returns:
Returns an object with two properties 'total' and 'th_count'
Type
Object

<static> headerCellsInFirstRow() → {Object}

Calculates the number of non-empty cells in the first row with content and how many of the non-empty cells are header cells

Source:
  • scripts/cache_tables.js, line 1148
Returns:
Returns an object with two properties 'total' and 'th_count'
Type
Object

<static> multipleTHInColumn(column)

Tests to see if there are multiple table header cells in a column and sets complex data table flag if there are

Parameters:
Name Type Description
column Number Number of the column to test for headers
Source:
  • scripts/cache_tables.js, line 862

<static> multipleTHInRow(row)

Tests to see if there are multiple table header cells in a row and sets complex data table flag if there are

Parameters:
Name Type Description
row Number Number of the row to test for headers
Source:
  • scripts/cache_tables.js, line 824

<static> nextRow()

Updates the current table cell counters and array to start a new row in the table

Source:
  • scripts/cache_tables.js, line 796

<static> setIsDataTable()

Set is a data table property, if not already set

Source:
  • scripts/cache_tables.js, line 576

<static> setIsLayoutTable()

Set is a data table property, if not already set

Source:
  • scripts/cache_tables.js, line 609

<static> setTableCellHeader(row, column, table_cell_element)

Sets header content property of the table cell element object

Parameters:
Name Type Description
row Number Current row position of the table cell element object
column Number Current column position of the table cell element object
table_cell_element TableCellElement Table cell element object to create header content property
Source:
  • scripts/cache_tables.js, line 993

<static> sortCellIds()

Sorts the cell ids array for this table based on the id values

Source:
  • scripts/cache_tables.js, line 961

<static> toString() → {String}

Creates a text string representation of the table element object

Source:
  • scripts/cache_tables.js, line 1373
Returns:
Returns a text string representation of the table
Type
String