Display Record Data in a Table

To display rows and columns of record data, use the lightning-datatable component. To display data in a table with a structural hierarchy, such as account records and associated contacts, use the lightning-tree-grid component. For more information, see Compare lightning-datatable and lightning-tree-grid.

With the lightning-datatable component, you can:

Alternatively, the lightning-tree-grid component is built on lightning-datatable and supports a subset of its features. You can create a hierarchical table of record data using lightning-tree-grid, which can present child records using a toggle in the datatable.

This documentation uses the term lightning-datatable component and datatable interchangeably.

Note

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.