-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:table): support td break-word display (#4273)
- Loading branch information
Showing
6 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
order: 26 | ||
title: | ||
en-US: Break Word | ||
zh-CN: 折行显示 | ||
--- | ||
|
||
## zh-CN | ||
|
||
当 `td` 内容超出 `nzWidth` 设定值时使用 `nzBreakWord` 折行显示 | ||
|
||
## en-US | ||
|
||
Insert line breaks within words with `nzBreakWord` to prevent text from overflowing its content box | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nz-demo-table-break-word', | ||
template: ` | ||
<nz-table #fixedTable [nzData]="listOfData" [nzScroll]="{ x: '1150px', y: '240px' }"> | ||
<thead> | ||
<tr> | ||
<th nzWidth="150px" nzLeft="0px">Full Name</th> | ||
<th nzWidth="100px" nzLeft="150px">Age</th> | ||
<th nzWidth="100px">Column 1</th> | ||
<th nzWidth="100px">Column 2</th> | ||
<th nzWidth="100px">Column 3</th> | ||
<th nzWidth="100px">Column 4</th> | ||
<th nzWidth="100px">Column 5</th> | ||
<th nzWidth="100px">Column 6</th> | ||
<th nzWidth="100px">Column 7</th> | ||
<th nzWidth="100px">Column 8</th> | ||
<th nzWidth="100px" nzRight="0px">Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let data of fixedTable.data"> | ||
<td nzBreakWord nzLeft="0px">{{ data.name }}</td> | ||
<td nzBreakWord nzLeft="150px">{{ data.age }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord>{{ data.address }}</td> | ||
<td nzBreakWord nzRight="0px"> | ||
<a>action</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</nz-table> | ||
` | ||
}) | ||
export class NzDemoTableBreakWordComponent implements OnInit { | ||
listOfData: any[] = []; | ||
|
||
ngOnInit(): void { | ||
for (let i = 0; i < 100; i++) { | ||
this.listOfData.push({ | ||
name: `Edward King ${i} Edward King ${i} Edward King ${i}`, | ||
age: 32, | ||
address: `LondonLondonLondonLondonLondon` | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 26 | ||
order: 27 | ||
title: | ||
en-US: Dynamic Settings | ||
zh-CN: 动态控制表格属性 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters