Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comparison table to table guidelines #4006

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Every table can be extended with these functionalities:
* [Expandable table](#expandable-table)
* [Compound expandable table](#compound-expandable-table)
* [Actionable table](#actionable-table)
* [Comparison table](#comparison-table)
* [Row striping](#row-striping)
* [Sortable table](#sorting-by-columns)
* [Table with favoriting](#table-with-favoriting)
Expand Down Expand Up @@ -118,6 +119,32 @@ The actionable table provides checkboxes or radio buttons that enable users to s
#### When not to use
* Users can not take any actions on table items/rows.

### Comparison table
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add this as a list item on line 77?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch!! Just updated


For tables used to compare different items against different parameters, you may use a customized version of a table.


<img src="./img/comparison-table.png" alt="example of comparison table" width="800"/>


The comparison table differs from a standard table in the follow ways:
* The items being compared should be shown as columns.
* The parameters should be a sticky column on the far left of the table, with each parameter having its own row.
* The table should contain both horizontal and vertical lines to separate items, aiding content scanning.
* The table should have a nested header for the items being compared to help visualize the data.
* (optional) The table can be striped to help scan and compare between the different parameters.
* (optional) If you choose to add actions, they should be at the individual cell level and not at the row level.

#### Actions in a comparison table

Actions in a comparison table could include:
* Adding or removing an item for comparison
* Adding or removing a parameter row for comparison
* Exporting comparison table

Although you could include the ability to remove certain parameters from inside the table, with an X button at the cell level, it is recommended that the greater management of a table be triggered from an action inside the table toolbar. For example, you could have an “Add to comparison” button in the toolbar that could open a modal in which a user could select the parameters they want to see and/or the items they want to compare.


### Row striping
Row striping can help improve legibility of a table when presenting large amounts of data. With row striping enabled, table rows will alternate between ```--pf-v5-global--BackgroundColor--100``` and ```--pf-v5-global--BackgroundColor--150``` to visually separate dense data sets.

Expand Down
Loading