Angular 带上方标题行的角度素描冻结标题行

Angular 带上方标题行的角度素描冻结标题行,angular,scroll,primeng,Angular,Scroll,Primeng,我用的是带角度的素数库。我有以下代码: <p-table [value]="data"> <ng-template pTemplate="caption"> Some caption test </ng-template> <ng-template pTemplate="header"> <tr> <th>Some column</th>

我用的是带角度的素数库。我有以下代码:

<p-table [value]="data">

    <ng-template pTemplate="caption">
        Some caption test
    </ng-template>

    <ng-template pTemplate="header">
      <tr>
       <th>Some column</th>
       <th>Some column1</th>
       <th>Some column2</th>
      </tr>
    </ng-template>

  ...Rest of table body here
</p-table>

一些字幕测试
某专栏
一些专栏1
一些专栏2
…桌子的其他部分在这里

当我将表格设置为[scrollable]=“true”和scrollHeight=“200px”时,标题行和标题行不再对齐。有办法解决这个问题吗

您可以在标题标题的右边空白处与行标题对齐

<p-table styleClass="prime-table" [scrollable]="true" scrollHeight="200px">


.prime-table.ui-table .ui-table-caption.ui-widget-header {
   margin-right: 17px;
}

.prime-table.ui-table.ui-table-caption.ui-widget-header{
右边距:17px;
}

您可以在标题标题的右边空白处与行标题对齐

<p-table styleClass="prime-table" [scrollable]="true" scrollHeight="200px">


.prime-table.ui-table .ui-table-caption.ui-widget-header {
   margin-right: 17px;
}

.prime-table.ui-table.ui-table-caption.ui-widget-header{
右边距:17px;
}