This is an accessible, sortable, and scrollable table for displaying tabular data (like revenue and other analytics data). It accepts `headers` for column headers, and `rows` for the table content. `rowHeader` can be used to define the index of the row header (or false if no header).
`TableCard` serves as Card wrapper & contains a card header, `<Table />`, `<TableSummary />`, and `<Pagination />`. This includes filtering and comparison functionality for report pages.
`Table` itself can be used outside of the Card + filtering context for displaying any tabular data.
`TableSummary` can also be used alone, and will display the list of data passed in on a single line.
*`summary`: An array of objects with `label`&`value` properties, which display in a line under the table. Optional, can be left off to show no summary.
*`title` (required): The title used in the card header, also used as the caption for the content in this table
`rows`, `headers`, `rowHeader`, and `title` are passed through to `<Table />`. `summary` is passed through as `data` to `<TableSummary />`. `query.page`, `query.per_page`, and `onQueryChange` are passed through to `<Pagination />`.
*`headers[].isSortable`: Boolean, true if this column is sortable.
*`headers[].key`: The API parameter name for this column, passed to `orderby` when sorting via API.
*`headers[].label`: The display label for this column.
*`headers[].required`: Boolean, true if this column should always display in the table (not shown in toggle-able list).
*`onSort`: A function called when sortable table headers are clicked, gets the `header.key` as argument.
*`rows` (required): An array of arrays of display/value object pairs. `display` is used for rendering, strings or elements are best here. `value` is used for sorting, and should be a string or number. A column with `false` value will not be sortable.
*`rowHeader`: Which column should be the row header, defaults to the first item (`0`) (but could be set to `1`, if the first col is checkboxes, for example). Set to false to disable row headers.
Row data should be passed to the component as a list of arrays, where each array is a row in the table. Headers are passed in separately as an array of strings. For example, this data would render the following table.