html - Angular Flex 是否可以有多个粘性列?

标签 html css angular angular-material angular-flex-layout

我有一个包含信息列和日期列的 Angular Material 表。我想让信息栏留在左侧,意味着粘性。

我已经尝试将“粘性”标签添加到所有我想要粘性但没有成功的列。

<table mat-table [dataSource]="dataSource" matSort class="mat-elevation-z8" >
  <ng-container matColumnDef="group" sticky>
    <th mat-header-cell class="group" *matHeaderCellDef mat-sort-header> Konzern </th>
    <td mat-cell class="group" *matCellDef="let element"> {{element.group}} </td>
  </ng-container>

  <ng-container matColumnDef="customer"sticky>
    <th mat-header-cell class="customer" *matHeaderCellDef mat-sort-header> Kunde </th>
    <td mat-cell class="customer" *matCellDef="let element"> {{element.customer}} </td>
  </ng-container>

  <ng-container matColumnDef="brand" sticky>
    <th mat-header-cell class="brand" *matHeaderCellDef mat-sort-header> Marke </th>
    <td mat-cell class="brand" *matCellDef="let element"> {{element.brand}} </td>
  </ng-container>


  <ng-container matColumnDef="subBrand" sticky>
    <th mat-header-cell class="subBrand" *matHeaderCellDef mat-sort-header> Submarke </th>
    <td mat-cell class="subBrand" *matCellDef="let element"> {{element.subBrand}} </td>
  </ng-container>

  <ng-container matColumnDef="subgroup" sticky>
    <th mat-header-cell class="subgroup" *matHeaderCellDef mat-sort-header> Untergruppe </th>
    <td mat-cell class="subgroup" *matCellDef="let element"> {{element.subgroup}} </td>
  </ng-container>

  <ng-container *ngFor="let week of this.displayedRowInformation; let i=index" [matColumnDef]="i.toString()">
    <th mat-header-cell class="week" [id]="i.toString()" *matHeaderCellDef> {{week.weeknumber}} </th>
    <td mat-cell class="week" *matCellDef="let element">
      <div style="position:relative">
        <div>{{ getEvent(week, element).description}}</div>
      </div>
    </td>
  </ng-container>

  <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
  <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>

最佳答案

我认为this site可以帮助你。您可以通过更改站点中的选项来检查。

https://tburleson-layouts-demos.firebaseapp.com/#/docs

关于html - Angular Flex 是否可以有多个粘性列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55351435/

相关文章:

html - 如何正确地 <use> <svg> 元素来加载外部资源?

html - CSS3 动画变换旋转在 Firefox 中不起作用

html - 如何使用 `content_for?`方法实现动态布局列?

php - 将登录或注册链接移动到标题导航中的顶部链接 - Magento

angular - 类型元素上不存在单选按钮值

html - IE7 及更早版本中的溢出问题

asp.net - 我无法使我的 gridview 的标题可以点击进行排序

css - 使用 bootstrap 3 在水平表单布局下方居中对齐按钮

javascript - Angular Testing : Uncaught Error: Uncaught (in promise): Error: Cannot match any routes. URL 段: 'home'

javascript - typescript 'is not a module' 错误