Вот мое решение, я использовал bootstrap, чтобы сделать его отзывчивым.
Я обернул ваш раздел классом .container-fluid
, а затем обернул внутренние компоненты классами .row
и col-*
. Откройте пример в полноэкранном режиме.
Чтобы сделать его 100% высоты, я использовал height: calc(100vh - 54px);
100vh означает, что он принимает высоту вашего окна просмотра.
Вычитание 54px равно сделано, чтобы избежать прокрутки всей страницы
.test {
overflow-y: auto !important;
height: calc(100vh - 54px);
/*54px is height of navbar*/
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-expand-md navbar-light fixed-top bg-light">
<div class="ml-auto">
<input class="form-control" name="search" [(ngModel)]="search" type="search" placeholder="Search" />
</div>
</nav>
<br/><br/>
<div class="container-fluid">
<section class="row">
<div class="col-md-8 col-12 overflow-auto test">
<table class="table table-hover">
<tr>
<th>Date</th>
<th>List Name</th>
<th>No. of Entities</th>
</tr>
<tbody>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
<tr *ngFor="let items of data | filter: search">
<td>{{ items.date }}</td>
<td>{{ items.name }}</td>
<td>{{ items.entities }}</td>
<td>
<button type="button" class="btn btn-outline-secondary" (click)="getdetails(items)">
Details
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-4 col-12 overflow-auto test">
<div class="alert alert-dark">+Add Description</div>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
<p>{{s}}</p>
</div>
</section>
</div>