Table
A table displays rows of data.
When To Use#
- To display a collection of structured data.
- To sort, search, paginate and filter data.
import { NzTableModule } from 'ng-zorro-antd/table';
How To Use#
The Table component is both easy to use and highly customizable.
Highly Customizable#
The nz-table
can be used like W3C Standard <table>
. Developers can control every part of the table as they wish.
Component Enhancements#
The component in nz-table
such as th
, td
, thead
etc. are enhanced. Developers can make the table sortable, filterable, with fixed header, perform server side rendering etc. easily with the provided api.
Data Processing#
The data passed to [nzData]
is exported with Template Context after processing (including paging, sorting and filtering). *ngFor
can be used to render current page data in table.
<nz-table #basicTable [nzData]="dataSet">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Address</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td>{{data.age}}</td>
<td>{{data.address}}</td>
<td>
<a>Action 一 {{data.name}}</a>
<nz-divider nzType="vertical"></nz-divider>
<a>Delete</a>
</td>
</tr>
</tbody>
</nz-table>
Examples
Name | Age | Address | Action |
---|---|---|---|
John Brown | 32 | New York No. 1 Lake Park | Action 一 John Brown |
Jim Green | 42 | London No. 1 Lake Park | Action 一 Jim Green |
Joe Black | 32 | Sidney No. 1 Lake Park | Action 一 Joe Black |
Loading...
Name | Age | Address | |
---|---|---|---|
Edward King 0 | 32 | London, Park Lane no. 0 | |
Edward King 1 | 32 | London, Park Lane no. 1 | |
Edward King 2 | 32 | London, Park Lane no. 2 | |
Edward King 3 | 32 | London, Park Lane no. 3 | |
Edward King 4 | 32 | London, Park Lane no. 4 | |
Edward King 5 | 32 | London, Park Lane no. 5 | |
Edward King 6 | 32 | London, Park Lane no. 6 | |
Edward King 7 | 32 | London, Park Lane no. 7 | |
Edward King 8 | 32 | London, Park Lane no. 8 | |
Edward King 9 | 32 | London, Park Lane no. 9 |
Loading...
Name | Age | Address | |
---|---|---|---|
Edward King 0 | 32 | London, Park Lane no. 0 | |
Edward King 1 | 32 | London, Park Lane no. 1 | |
Edward King 2 | 32 | London, Park Lane no. 2 | |
Edward King 3 | 32 | London, Park Lane no. 3 | |
Edward King 4 | 32 | London, Park Lane no. 4 | |
Edward King 5 | 32 | London, Park Lane no. 5 | |
Edward King 6 | 32 | London, Park Lane no. 6 | |
Edward King 7 | 32 | London, Park Lane no. 7 | |
Edward King 8 | 32 | London, Park Lane no. 8 | |
Edward King 9 | 32 | London, Park Lane no. 9 |
Loading...
Jim Green | 42 | London No. 1 Lake Park |
Jim Red | 32 | London No. 2 Lake Park |
Loading...
John Brown | 98 | 60 | 70 |
Jim Green | 98 | 66 | 89 |
Joe Black | 98 | 90 | 70 |
Jim Red | 88 | 99 | 89 |
Loading...
John Brown | 32 | New York No. 1 Lake Park |
Jim Green | 42 | London No. 1 Lake Park |
Joe Black | 32 | Sidney No. 1 Lake Park |
Jim Red | 32 | London No. 2 Lake Park |
Loading...
Age | Address | |
---|---|---|
John Brown | 32 | New York No. 1 Lake Park |
Jim Green | 42 | London No. 1 Lake Park |
Joe Black | 32 | Sidney No. 1 Lake Park |
Jim Red | 32 | London No. 2 Lake Park |
Loading...
Aitor Pascual | male | aitor.pascual@example.com |
Ömür Kıraç | female | omur.kirac@example.com |
Aurélien Rodriguez | male | aurelien.rodriguez@example.com |
Elly Holst | female | elly.holst@example.com |
Amelia Barnaby | female | amelia.barnaby@example.com |
Delia Bustos | female | delia.bustos@example.com |
Kay Newman | female | kay.newman@example.com |
Jadranka Ignjatović | female | jadranka.ignjatovic@example.com |
Wies Hurkens | female | wies.hurkens@example.com |
Felix Stefan | male | felix.stefan@example.com |
Loading...
Loading...
Loading...
Name | Age | Address | |
---|---|---|---|
John Brown | 32 | New York No. 1 Lake Park | |
My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park. | |||
Jim Green | 42 | London No. 1 Lake Park | |
My name is Jim Green, I am 42 years old, living in London No. 1 Lake Park. | |||
Joe Black | 32 | Sidney No. 1 Lake Park | |
My name is Joe Black, I am 32 years old, living in Sidney No. 1 Lake Park. |
Loading...
Name | Age | Address | |
---|---|---|---|
John Brown | 32 | New York No. 1 Lake Park | |
My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park. | |||
Jim Green | 42 | London No. 1 Lake Park | |
My name is Jim Green, I am 42 years old, living in London No. 1 Lake Park. | |||
Joe Black | 32 | Sidney No. 1 Lake Park | |
My name is Joe Black, I am 32 years old, living in Sidney No. 1 Lake Park. |
Loading...
Name | Age | Home phone | Address | ||
---|---|---|---|---|---|
John Brown | 32 | 0571-22098909 | 18889898989 | New York No. 1 Lake Park | |
Jim Green | 42 | 0571-22098333 | 18889898888 | London No. 1 Lake Park | |
Joe Black | 32 | 0575-22098909 | 18900010002 | Sidney No. 1 Lake Park | |
Jim Red | 18 | 18900010002 | London No. 2 Lake Park | ||
Jake White | 18 |
Loading...
Name | Age | Address |
---|---|---|
60 | New York No. 1 Lake Park | |
Joe Black | 32 | Sidney No. 1 Lake Park |
Loading...
Edward King 0 | 32 | London, Park Lane no. 0 |
Edward King 1 | 32 | London, Park Lane no. 1 |
Edward King 2 | 32 | London, Park Lane no. 2 |
Edward King 3 | 32 | London, Park Lane no. 3 |
Edward King 4 | 32 | London, Park Lane no. 4 |
Edward King 5 | 32 | London, Park Lane no. 5 |
Edward King 6 | 32 | London, Park Lane no. 6 |
Edward King 7 | 32 | London, Park Lane no. 7 |
Edward King 8 | 32 | London, Park Lane no. 8 |
Edward King 9 | 32 | London, Park Lane no. 9 |
Edward King 10 | 32 | London, Park Lane no. 10 |
Edward King 11 | 32 | London, Park Lane no. 11 |
Edward King 12 | 32 | London, Park Lane no. 12 |
Edward King 13 | 32 | London, Park Lane no. 13 |
Edward King 14 | 32 | London, Park Lane no. 14 |
Edward King 15 | 32 | London, Park Lane no. 15 |
Edward King 16 | 32 | London, Park Lane no. 16 |
Edward King 17 | 32 | London, Park Lane no. 17 |
Edward King 18 | 32 | London, Park Lane no. 18 |
Edward King 19 | 32 | London, Park Lane no. 19 |
Edward King 20 | 32 | London, Park Lane no. 20 |
Edward King 21 | 32 | London, Park Lane no. 21 |
Edward King 22 | 32 | London, Park Lane no. 22 |
Edward King 23 | 32 | London, Park Lane no. 23 |
Edward King 24 | 32 | London, Park Lane no. 24 |
Edward King 25 | 32 | London, Park Lane no. 25 |
Edward King 26 | 32 | London, Park Lane no. 26 |
Edward King 27 | 32 | London, Park Lane no. 27 |
Edward King 28 | 32 | London, Park Lane no. 28 |
Edward King 29 | 32 | London, Park Lane no. 29 |
Edward King 30 | 32 | London, Park Lane no. 30 |
Edward King 31 | 32 | London, Park Lane no. 31 |
Edward King 32 | 32 | London, Park Lane no. 32 |
Edward King 33 | 32 | London, Park Lane no. 33 |
Edward King 34 | 32 | London, Park Lane no. 34 |
Edward King 35 | 32 | London, Park Lane no. 35 |
Edward King 36 | 32 | London, Park Lane no. 36 |
Edward King 37 | 32 | London, Park Lane no. 37 |
Edward King 38 | 32 | London, Park Lane no. 38 |
Edward King 39 | 32 | London, Park Lane no. 39 |
Edward King 40 | 32 | London, Park Lane no. 40 |
Edward King 41 | 32 | London, Park Lane no. 41 |
Edward King 42 | 32 | London, Park Lane no. 42 |
Edward King 43 | 32 | London, Park Lane no. 43 |
Edward King 44 | 32 | London, Park Lane no. 44 |
Edward King 45 | 32 | London, Park Lane no. 45 |
Edward King 46 | 32 | London, Park Lane no. 46 |
Edward King 47 | 32 | London, Park Lane no. 47 |
Edward King 48 | 32 | London, Park Lane no. 48 |
Edward King 49 | 32 | London, Park Lane no. 49 |
Loading...
Loading...
Edward King 0 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 1 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 2 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 3 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 4 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 5 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 6 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 7 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 8 | 32 | London | London | London | London | London | London | London | London | action |
Edward King 9 | 32 | London | London | London | London | London | London | London | London | action |
Loading...
John Brown | 1 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 2 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 3 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 4 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 5 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 6 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 7 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 8 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 9 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
John Brown | 10 | Lake Park | C | 2035 | Lake Street 42 | SoftLake Co | M |
Loading...
Loading...
Name | Age | Address | Action |
---|---|---|---|
Edward 0 | 32 | London Park no. 0 | Edit |
Edward 1 | 32 | London Park no. 1 | Edit |
Edward 2 | 32 | London Park no. 2 | Edit |
Edward 3 | 32 | London Park no. 3 | Edit |
Edward 4 | 32 | London Park no. 4 | Edit |
Edward 5 | 32 | London Park no. 5 | Edit |
Edward 6 | 32 | London Park no. 6 | Edit |
Edward 7 | 32 | London Park no. 7 | Edit |
Edward 8 | 32 | London Park no. 8 | Edit |
Edward 9 | 32 | London Park no. 9 | Edit |
Loading...
Loading...
Loading...
Name | Age | Address |
---|---|---|
John Brown | 32 | New York No. 1 Lake Park |
Jim Green | 42 | London No. 1 Lake Park |
Joe Black | 32 | Sidney No. 1 Lake Park |
Loading...
Company | Contact | Country |
---|---|---|
Alfreds Futterkiste | Maria Anders | Germany |
Centro comercial Moctezuma | Francisco Chang | Mexico |
Ernst Handel | Roland Mendel | Austria |
Island Trading | Helen Bennett | UK |
Laughing Bacchus Winecellars | Yoshi Tannamuri | Canada |
Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
Loading...
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | action |
Loading...
Full Name | Age | Column 1 | Column 2 | Column ColumnColumn 3 | Column 4 |
---|---|---|---|---|---|
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon |
Edward King | 32 | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon | LondonLondonLondonLondonLondon |
Loading...
Name | Borrow | Repayment |
---|---|---|
John Brown | 10 | 33 |
Jim Green | 100 | 0 |
Joe Black | 10 | 10 |
Jim Red | 75 | 45 |
Total | 195 | 88 |
Balance | 107 |
Light | Everything that has a beginning, has an end. |
Bamboo | Everything that has a beginning, has an end. |
Little | Everything that has a beginning, has an end. |
Light | Everything that has a beginning, has an end. |
Bamboo | Everything that has a beginning, has an end. |
Little | Everything that has a beginning, has an end. |
Light | Everything that has a beginning, has an end. |
Bamboo | Everything that has a beginning, has an end. |
Little | Everything that has a beginning, has an end. |
Light | Everything that has a beginning, has an end. |
Loading...
Name | Age | Address | Action | ||
---|---|---|---|---|---|
John Brown | 12 | New York No. 1 Lake Park | Delete | ||
My name is John Brown, I am 12 years old, living in New York No. 1 Lake Park. | |||||
John Brown | 22 | New York No. 2 Lake Park | Delete | ||
My name is John Brown, I am 22 years old, living in New York No. 2 Lake Park. | |||||
John Brown | 32 | New York No. 3 Lake Park | Delete | ||
My name is John Brown, I am 32 years old, living in New York No. 3 Lake Park. | |||||
John Brown | 42 | New York No. 4 Lake Park | Delete | ||
My name is John Brown, I am 42 years old, living in New York No. 4 Lake Park. | |||||
John Brown | 52 | New York No. 5 Lake Park | Delete | ||
My name is John Brown, I am 52 years old, living in New York No. 5 Lake Park. | |||||
John Brown | 62 | New York No. 6 Lake Park | Delete | ||
My name is John Brown, I am 62 years old, living in New York No. 6 Lake Park. | |||||
John Brown | 72 | New York No. 7 Lake Park | Delete | ||
My name is John Brown, I am 72 years old, living in New York No. 7 Lake Park. | |||||
John Brown | 82 | New York No. 8 Lake Park | Delete | ||
My name is John Brown, I am 82 years old, living in New York No. 8 Lake Park. | |||||
John Brown | 92 | New York No. 9 Lake Park | Delete | ||
My name is John Brown, I am 92 years old, living in New York No. 9 Lake Park. | |||||
John Brown | 102 | New York No. 10 Lake Park | Delete | ||
My name is John Brown, I am 102 years old, living in New York No. 10 Lake Park. |
Loading...
Loading...
API#
nz-table#
Property | Description | Type | Default | Global Config |
---|---|---|---|---|
[nzData] | Data record array to be rendered | T[] | - | |
[nzFrontPagination] | Whether to paginate data on client. Should be set to false if data is to be paginated on server side or if all the data is to be displayed at once in the table without any pagination | boolean | true | |
[nzTotal] | Total data count. Should set when nzFrontPagination is false | number | - | |
[nzCustomColumn] | Control the display and sorting of table columns, (after enabling nzWidthConfig and [nzWidth] of th will not take effect) | NzCustomColumn[] | - | |
[nzPageIndex] | pageIndex , double binding | number | - | |
[nzPageSize] | pageSize, double binding | number | - | |
[nzShowPagination] | Whether to show pagination component at bottom of the table | boolean | true | |
[nzPaginationPosition] | Specify the position of pagination | 'top' | 'bottom' | 'both' | bottom | |
[nzPaginationType] | Specify the size of pagination | 'default' | 'small' | default | |
[nzBordered] | Whether to show all table borders | boolean | false | ✅ |
[nzOuterBordered] | Whether to show table outer borders | boolean | false | - |
[nzWidthConfig] | Set col width can not used with [nzWidth] of th | string[] | [] | |
[nzSize] | Size of table | 'middle' | 'small' | 'default' | 'default' | ✅ |
[nzLoading] | Loading status of table | boolean | false | |
[nzLoadingIndicator] | The loading indicator | TemplateRef<void> | - | ✅ |
[nzLoadingDelay] | Specifies a delay in milliseconds for loading state (prevents flush) | number | 0 | |
[nzScroll] | Whether table can be scrolled in x/y direction. x or y can be a string that indicates the width and height of table body | object | - | |
[nzTitle] | Table title renderer | string | TemplateRef<void> | - | |
[nzFooter] | Table footer renderer | string | TemplateRef<void> | - | |
[nzNoResult] | Custom no result content | string | TemplateRef<void> | - | |
[nzPageSizeOptions] | Specify the sizeChanger options | number[] | [10, 20, 30, 40] | |
[nzShowQuickJumper] | Determine whether you can jump to pages directly | boolean | false | ✅ |
[nzShowSizeChanger] | Determine whether nzPageSize can be changed | boolean | false | ✅ |
[nzShowTotal] | To display Pagination total number and range, same as Pagination | TemplateRef<{ $implicit: number, range: [ number, number ] }> | - | |
[nzItemRender] | To customize Pagination item, same as Pagination | TemplateRef<{ $implicit: 'page' | 'prev' | 'next', page: number }> | - | |
[nzHideOnSinglePage] | Whether to hide pagination on single page | boolean | false | |
[nzSimple] | Whether to use simple mode | boolean | - | ✅ |
[nzTemplateMode] | Template mode,no need to pass data to nzData | boolean | false | |
[nzVirtualItemSize] | The size of the items in the list, same as cdk itemSize | number | 0 | |
[nzVirtualMaxBufferPx] | The number of pixels worth of buffer to render for when rendering new items, same as cdk maxBufferPx | number | 200 | |
[nzVirtualMinBufferPx] | The minimum amount of buffer rendered beyond the viewport (in pixels),same as cdk minBufferPx | number | 100 | |
[nzVirtualForTrackBy] | The TrackByFunction to be used for tracking changes. | TrackByFunction<T> | - | |
[noDataVirtualHeight] | Height of inner scroll when having no data, if nothing is passed the default value is used. | string | '182px' | |
(nzPageIndexChange) | Callback when pageIndex changes | EventEmitter<number> | - | |
(nzPageSizeChange) | Callback when pageSize changes | EventEmitter<number> | - | |
(nzCurrentPageDataChange) | Callback when current pageData changes | EventEmitter<T[]> | - | |
(nzCustomColumnChange) | Callback when the table is reordered | EventEmitter<NzCustomColumn[]> | - | |
(nzQueryParams) | Callback with params when working with server side pagination, sorting and filtering | EventEmitter<NzTableQueryParams> | - |
th#
Checkbox property
Property | Description | Type | Default |
---|---|---|---|
[nzShowCheckbox] | Whether nz-checkbox should be shown in the header | boolean | - |
[nzDisabled] | Whether the nz-checkbox is disabled | boolean | - |
[nzIndeterminate] | nz-checkbox indeterminate status | boolean | - |
[nzLabel] | ARIA label for the nz-checkbox | string | - |
[nzChecked] | Checked status, double binding | boolean | - |
(nzCheckedChange) | Callback when checked status changes | EventEmitter<boolean> | - |
Selection property
Property | Description | Type | Default |
---|---|---|---|
[nzShowRowSelection] | Whether to show row selection options | boolean | - |
[nzSelections] | Selection options including text and onSelect callback function | Array<{ text: string, onSelect: any }> | - |
Sort property
Property | Description | Type | Default |
---|---|---|---|
[nzShowSort] | Whether to display sorting | boolean | - |
[nzSortFn] | Sort function used to sort the data on client side (ref to Array.sort compareFunction). Should be set to true when using server side sorting | NzTableSortFn<T> | boolean | - |
[nzSortOrder] | Sort direction | 'ascend' | 'descend' | null | - |
[nzSortDirections] | Supported sort order, could be 'ascend' , 'descend' , null | Array<'ascend' | 'descend' | null> | ['ascend', 'descend', null] |
(nzSortOrderChange) | Callback when sort direction changes | EventEmitter<'ascend' | 'descend' | null> | - |
Filter property
Property | Description | Type | Default |
---|---|---|---|
[nzShowFilter] | Whether to show filter | boolean | - |
[nzFilterFn] | Filter function used to filter the data on client side. Set to true when using server side filtering | NzTableFilterFn<T> | boolean | - |
[nzFilters] | Filter options, text , and value for callback, byDefault to enable filter by default | Array<{ text: string; value: any; byDefault?: boolean }> | - |
[nzFilterMultiple] | Whether multiple mode filtering is enabled | boolean | true |
(nzFilterChange) | Callback when filter value changes | EventEmitter<any[] | any> | - |
Style property
Property | Description | Type | Default |
---|---|---|---|
[nzWidth] | Specify the column width (in pixels), can not used when grouping columns | string | - |
[nzLeft] | Left pixels, used to fixed column to left, auto calc when set to true and disable fixed when false | string | boolean | - |
[nzRight] | Right pixels, used to fixed column to right, auto calc when set to true and disable fixed when false | string | boolean | - |
[nzAlign] | Specify how content is aligned | 'left' | 'right' | 'center' | - |
[nzCellControl] | Set the position of the column, which is the value of the value field in the NzCustomColumn type | string | - |
[nzBreakWord] | Whether insert line breaks within words | boolean | false |
[nzEllipsis] | ellipsis cell content, not working with sorter and filters for now. Only work when nzTableLayout was fixed | boolean | false |
Other
Property | Description | Type | Default |
---|---|---|---|
[nzColumnKey] | column key, work with server sort and filter | string | - |
td#
Checkbox property
Property | Description | Type | Default |
---|---|---|---|
[nzShowCheckbox] | Whether add nz-checkbox | boolean | - |
[nzDisabled] | Whether disable checkbox | boolean | - |
[nzIndeterminate] | Indeterminate status | boolean | - |
[nzLabel] | ARIA label for the nz-checkbox | string | - |
[nzChecked] | Checked status, double binding | boolean | - |
(nzCheckedChange) | Checked status change callback | EventEmitter<boolean> | - |
[colSpan] | how many columns the cell extends | number | null |
[rowSpan] | how many rows the cell extends | number | null |
Expand property
Property | Description | Type | Default |
---|---|---|---|
[nzShowExpand] | Whether show expand icon | boolean | - |
[nzExpand] | Current expand status, double binding | boolean | - |
[nzExpandIcon] | Custom expand icon | TemplateRef<void> | - |
(nzExpandChange) | Expand status change callback | EventEmitter<boolean> | - |
Style property
Property | Description | Type | Default |
---|---|---|---|
[nzLeft] | Left pixels, used to fixed column to left, auto calc when set to true and disable fixed when false | string | boolean | - |
[nzRight] | Right pixels, used to fixed column to right, auto calc when set to true and disable fixed when false | string | boolean | - |
[nzAlign] | Specify how content is aligned | 'left' | 'right' | 'center' | - |
[nzCellControl] | Set the position of the column, which is the value of the value field in the NzCustomColumn type | string | - |
[nzBreakWord] | Whether insert line breaks within words | boolean | false |
[nzEllipsis] | ellipsis cell content, not working with sorter and filters for now. Only work when nzTableLayout was fixed | boolean | false |
Other property
Property | Description | Type | Default |
---|---|---|---|
[nzIndentSize] | Indent size in pixels of tree data | number | - |
thead#
Property | Description | Type | Default |
---|---|---|---|
(nzSortOrderChange) | sort change callback,should used with nzColumnKey of th | EventEmitter<{ key: string, value: 'descend' | 'ascend' | null }> | - |
tr#
Property | Description | Type | Default |
---|---|---|---|
[nzExpand] | Whether expand current row,used with nzExpand of td | boolean | - |
tfoot#
Property | Description | Type | Default |
---|---|---|---|
[nzSummary] | Summary content | boolean | - |
[nzFixed] | Fixed summary, used with nzScroll | boolean | 'top' | 'bottom' | false |
nz-filter-trigger#
Customized filter panel
Property | Description | Type | Default |
---|---|---|---|
[nzDropdownMenu] | Dropdown menu | NzDropdownMenuComponent | - |
[nzVisible] | whether the dropdown menu is visible, double binding | boolean | - |
[nzActive] | whether the icon status is activated | boolean | false |
[nzHasBackdrop] | Whether or not attach a backdrop. | boolean | false |
(nzVisibleChange) | a callback function takes an argument: nzVisible , is executed when the visible state is changed | EventEmitter<boolean> | - |
[nz-virtual-scroll]#
virtual scroll directive work with ng-template
, type: TemplateRef<{ $implicit: T, index: number }>
.
Note#
In order to get better performance, all NG-ZORRO's components are running under OnPush mode, this means any mutate to the @Input()
data won't trigger change detection, please use immutable way to update array or object.
// add data
this.dataSet = [
...this.dataSet,
{
key: `${this.i}`,
name: `Edward King ${this.i}`,
age: '32',
address: `London, Park Lane no. ${this.i}`
}
];
// remove data
this.dataSet = this.dataSet.filter(d => d.key !== i);
Recommend using immer for a better development experience.