NG-ZORRO/ng-zorro-antd

Virtual table column alignment issue

Opened this issue · 2 comments

Reproduction link

https://stackblitz.com/edit/angular-fhlakd?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

  1. Use the nz-table component to create a table with virtual scrolling
  2. Set the number of rows in the table data to less than the amount required for scrollbar to appear.

What is expected?

The table columns should be aligned to the column headings, even if there is no scrollbar present.

What is actually happening?

There is excess padding at the end of the table headers to accomodate for the scrollbar.
This padding is present even if there are not enough items for there to be scroll.

Environment Info
ng-zorro-antd 16.2.2
Browser any

I currently have the same problem. Did you find a fix?

In the end, I'm always displaying the y-scroll, no matter how many rows are in the table. This way, the header will always be aligned with the body, and I stylled the scrollbar to be more pleasent to the eye