NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.85k stars 3.9k forks source link

NzTable fixedheader By nzScroll only set y, column width not long as content when add "nowrap" on text #5605

Open Wsp0000 opened 4 years ago

Wsp0000 commented 4 years ago

Reproduction link

https://stackblitz.com/edit/angular-nz-table-wrap-issue

Steps to reproduce

  1. create nzTable #fixedTable
  2. nz-table with [nzScroll]="{ y: '200px' }"
  3. add style="white-space:nowrap"
  4. column width too short

please see png: Upper half is what I expected, lower half is steps to reproduce What i encountered angular9-table-nowrap-issue

What is expected?

column width long as content, when add style="white-space:nowrap",

What is actually happening?

after add style="white-space:nowrap", "#fixedTable" column width become seems average the window width

Environment Info
ng-zorro-antd 9.3.0
Browser Chrome 84.0.4147.89

What I expected result is "#expectedTable" in link to minimal reproduction (but this approach table header not fixed, because scroll is outside table) or if this not the issue, can it be Feature Request?

Wsp0000 commented 4 years ago

Hi @vthinkxie May I ask is this issue will be fixed?

or just a rare use case that will deal with it someday? or If there are other considerations...?

duongthan29 commented 3 years ago

Hi @vthinkxie May I ask is this issue will be fixed?

or just a rare use case that will deal with it someday? or If there are other considerations...?

You can use colspan attribute in th and td of table. and set large X attribute in nzScroll (eg 1500px)