如何添加带有冻结列的colspan

时间:2019-07-03 13:04:42

标签: primeng primeng-datatable

未冻结的第一个标头出现在冻结列中,即“第三次提交”。如何为冻结的列设置空白标题
enter image description here

              <ng-template pTemplate="caption">
                <div class="ui-helper-clearfix">
                  <div class="p-grid">
                    <div class="p-col-8" style="padding-left: 35%;padding-top:12px;">Monthly Variance Analysis</div>
                    <div class="p-col-4">
                      <button type="button" pButton icon="fas fa-file-export" iconPos="right" label="Export"
                        (click)="ExportCountryVarianceClicked('VarianceGrid')"
                        style="margin-bottom: -6px;float:right;width:50%;font-size: small;"></button>
                    </div>
                  </div>
                </div>
              </ng-template>

              <ng-template pTemplate="colgroup" let-columns>
                <colgroup>
                  <col *ngFor="let col of columns" style="width:150px">
                </colgroup>
              </ng-template>

              <ng-template pTemplate="header" let-columns>
                <tr style="font-size: small;">
                  <th style="width:450px" colspan="3">3rd Submission</th>
                  <th style="width:450px" colspan="3">2nd Submission</th>
                  <th style="width:450px" colspan="3">1st Submission</th>
                </tr>
                <tr>
                  <th *ngFor="let col of columns">
                    {{col.header}}
                  </th>
                </tr>
              </ng-template>

              <ng-template pTemplate="body" let-forecastAcutal let-columns="columns">
                <tr style="font-size: small;">
                  <td *ngFor="let col of columns">
                    {{forecastAcutal[col.field]}}
                  </td>

                </tr>
              </ng-template>
</p-table>

请随时更正代码格式。我是堆栈溢出的新手

0 个答案:

没有答案