Skip to content

Commit

Permalink
Improve Accessibility - captions
Browse files Browse the repository at this point in the history
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption

> A caption functions like a heading for a table. Most screen readers announce the content of captions. Captions help users to find a table and understand what it’s about and decide if they want to read it. If the user uses “Tables Mode”, captions are the primary mechanism to identify tables. The caption is provided by the <caption> element.

from: https://www.w3.org/WAI/tutorials/tables/caption-summary/
  • Loading branch information
lalong13 authored Jan 24, 2024
1 parent cdb9e18 commit 75285d6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const MRT_Table = <TData extends MRT_RowData>({
getFlatHeaders,
getState,
options: {
caption,
columns,
enableStickyHeader,
enableTableFooter,
Expand Down Expand Up @@ -67,6 +68,7 @@ export const MRT_Table = <TData extends MRT_RowData>({
...(parseFromValuesOrFunc(tableProps?.sx, theme) as any),
})}
>
{caption && (typeof caption === 'string' ? <caption>{caption}</caption> : caption)}
{enableTableHead && <MRT_TableHead {...commonTableGroupProps} />}
{memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (
<Memo_MRT_TableBody {...commonTableGroupProps} />
Expand Down

0 comments on commit 75285d6

Please sign in to comment.