1

Does anyone know of a plugin for Angular2 in where you can pin or make static the whole first column while leaving the other columns with a horizontal scroll, I have tried already playing with css positions to no success.

I see for angular.js and jquery there are many plugins to achieve this but none that I can find for angular2

CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186

1 Answers1

1

I used this solution, and it works for me.

 .mat-table > mat-header-row:first-child > mat-header-cell:first-child, mat-cell:first-child {
  position: absolute;
  display: flex;
  background-color: white;
  width: 150px;
  min-height: 42px;
  left: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  align-items: center;
  padding: 0 24px;
  margin-top: 4px;
}

.mat-table > mat-header-row:first-child > mat-header-cell:first-child {
  border-bottom: 0;
  margin-top: 0;
}

.mat-table > mat-header-row:nth-child(2) > mat-header-cell:nth-child(2), mat-cell:nth-child(2) {
  margin-left: 160px;
}

You might have to adjust border and padding according to your needs.