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 data table.