generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
In our ERP application, we frequently need to display aggregated data (e.g., sum, average, count) at the bottom of a table. Currently, the Table component in Cloudscape does not provide a built-in way to render a total row.
Developers need to manually append a custom row outside of the component, which makes styling and alignment inconsistent with the rest of the table.
It would be helpful if the Table component supported a Total Row (Footer Row) feature, similar to how many enterprise data grid libraries provide summary rows.
- Option to enable a footer row.
- Ability to define aggregations (sum, average, min, max, custom).
- Consistent styling with table cells, aligned with columns.
- Sticky footer option, similar to sticky header.
Example
<Table
header={<Header>Purchase Orders</Header>}
columnDefinitions={[
{ id: 'item', header: 'Item', cell: item => item.name },
{ id: 'qty', header: 'Quantity', cell: item => item.qty },
{ id: 'price', header: 'Price', cell: item => item.price },
]}
items={[
{ name: 'Fabric A', qty: 10, price: 200 },
{ name: 'Fabric B', qty: 5, price: 100 },
]}
totalRow={{
cells: {
item: 'Total',
qty: (items) => items.reduce((sum, i) => sum + i.qty, 0),
price: (items) => items.reduce((sum, i) => sum + i.price, 0),
},
sticky: true
}}
/>Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate requests
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request