`
<colgroup> <col span="1" style="width: 50%;"> <col span="2" style="width: 50%;"> </colgroup> <tr class="others-row"> <td class="traverse table-td-height"> <p class="others-type">Feature</p> </td> <td class="other-c-table-td table-td-height"> <mat-form-field appearance="none"> <ng-container *ngIf="!row.reviewed && !testThreatSource(row.threatSource)"> <mat-select [(ngModel)]="row.fromFeature" (ngModelChange)="onFeatureChange(row)"> <mat-option *ngFor="let selected of featureList.name; trackBy: trackByFeature" [value]="selected"> {{selected}} </mat-option> </mat-select> </ng-container> <ng-container *ngIf="row.reviewed || testThreatSource(row.threatSource)"> <textarea matInput [ngModel]="row.fromFeature" [readonly]="true" cdkTextareaAutosize #autosize="cdkTextareaAutosize" cdkAutosizeMinRows="1" cdkAutosizeMaxRows="2"></textarea> </ng-container> </mat-form-field> </td> </tr>
`这是图像我想修复 tr 大小如果我在 tr 内得到多行而不展开 tr 高度调整相同的表行。在下图中,您可以看到由于第一行中有多行,我的行变得不合适
特点 {{已选择}}
请提供更多信息以明确您的要求。
要获取角度元素,您可以使用
@ViewChild
。查看文档。 https://angular.io/api/core/ViewChild要直接操作 ts 文件中的元素,您可以使用 Renderer2。 https://angular.io/api/core/Renderer2