Skip to content

Commit 5062efb

Browse files
docs(cdk/table): document fixedLayout and recycleRows
1 parent 65330c2 commit 5062efb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/cdk/table/table.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ updates. This can be based on _anything_: websocket connections, user interactio
135135
time-based intervals, etc. Most commonly, updates will be triggered by user interactions like
136136
sorting and pagination.
137137

138+
##### `fixedLayout`
139+
Enabling this option will enforce uniform column widths and optimize the rendering of sticky
140+
elements in the table.
141+
142+
```html
143+
<table cdk-table [dataSource]="dataSource" fixedLayout>
144+
```
145+
138146
##### `trackBy`
139147

140148
To improve performance, a `trackBy` function can be provided to the table similar to Angular’s
@@ -145,6 +153,16 @@ table how to uniquely identify rows to track how the data changes with each upda
145153
<table cdk-table [dataSource]="dataSource" [trackBy]="myTrackById">
146154
```
147155

156+
##### `recycleRows`
157+
When the rendered rows change, the table discards the old rows and creates new ones from
158+
scratch. Tables that do not animate rows or use multiple row templates can improve performance by
159+
enabling row recycling, which caches row templates when they're no longer needed, and reuses them
160+
when creating new rows.
161+
162+
```html
163+
<table cdk-table [dataSource]="dataSource" recycleRows>
164+
```
165+
148166
### Alternate HTML to using native table
149167

150168
The CDK table does not require that you use a native HTML table. If you want to have full control

0 commit comments

Comments
 (0)