Is it possible to add a drop shadow to the 1st column of an Angular Material table?
I have tried a couple approaches with ::ng-deep or adding classes, but without much success.
Below is my basic code. The right border via the CSS shows in the table in the 1st column, but not the shadow. And the moment I start scrolling to the right, the border disappears (my 1st column is sticky).
I would like to add a drop shadow to the 1st column, that will not be removed on scrolling.
CSS
.column-shadow {
border-right: 1px solid $af-pinkish-grey !important;
box-shadow: 3px 3px 5px rgba(68, 68, 68, 0.6) !important;
}
HTML
<!-- action buttons -->
<ng-container matColumnDef="select" sticky>
<th mat-header-cell *matHeaderCellDef>
Action
</th>
<td
[ngClass]="'column-shadow'"
mat-cell
*matCellDef="let row; let index = index"
>
<!-- Select record -->
<mat-checkbox
color="primary"
(click)="$event.stopPropagation()"
(change)="selectRecord($event.checked, index)"
[checked]="selection.isSelected(row)"
[aria-label]="checkboxLabel(row)"
>
</mat-checkbox>
<span class="delete-edit-row">
<!-- Delete single record -->
<a
class="action-button"
mat-button
(click)="deleteSingleRecord(index)"
><img
class="close-button-image"
src="../../../assets/images/trashgrid.svg"
/></a>
</span>
</td>
</ng-container>