aria-colcount (property)

aria-colcount (property)

Dynamic tables are quite common in modern web. Number of columns depends on the data fetched by the input given by the user or any other parameters that define the table. aria-colcount (property) will be ideal to use in scenarios where the total number of columns are not available currently in the DOM. If all the columns of the table are present in the DOM aria-colcount (property) is not required. The user agents can calculate the total number of columns in the table and share it with assistive technologies.

Along with aria-colcount property aria-colindex property also need to be provided for user agents to effectively inform the position of current column within the table in case of dynamic tables.

Developers must set the value of aria-colcount to an integer equal to the number of columns in the full table. In case the total number of columns is unknown, authors must set the value of aria-colcount to -1 to indicate that the value should not be calculated by the user agent.

Aria-colcount property used in roles

Values of aria-colcount property

Integer that is equal to the total number of columns in the table. The value must be -1 (minus one) if the total number of columns is unknown.

Leave a Reply