Import
Basic Usage
API Reference
MatTable
Selector:mat-table, table[mat-table]
Exported as: matTable
Extends CdkTable from @angular/cdk/table - see CDK Table documentation for full API.
Properties
| Name | Type | Description |
|---|---|---|
@Input() dataSource | DataSource<T> | Observable<T[]> | T[] | Data source for the table |
@Input() fixedLayout | boolean | Whether to use fixed table layout |
Column Definition
Define columns usingmatColumnDef:
Examples
With MatTableDataSource
With Actions Column
Sticky Header
Footer Row
Row Selection
Expandable Rows
No Data Row
Styling
Table Styles
Accessibility
- Use semantic table elements
- Provide descriptive headers
- Use
scopeattributes:
- Add
captionfor context:
Performance
For large datasets:Related Components
- Sort - Add sorting to table columns
- Paginator - Add pagination
- Form Field - For filtering