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

Table header and content misalignment #7657

Open razvanbh opened 1 year ago

razvanbh commented 1 year ago

Reproduction link

https://stackblitz.com/edit/angular-f6ptlu

Steps to reproduce

  1. Create a nz-table with [nzScroll]="{ x: 'auto', y: '300px' }"
  2. Add a table header with nzWidth set and a long header text

What is expected?

If header is wider than the set nzWidth the columns in the table take the table header width instead of the nzWidth value.

What is actually happening?

The columns in the table are taking the width from nzWidth, but the header is getting wider, and the table is not aligned anymore with the header. image

Environment Info
ng-zorro-antd 14.0.0
Browser Chrome
simplejason commented 1 year ago

Use nzBreakWord or change the styles of th manually