How to make sure a bootstrap row fills the rest of the page without exceeding the height of the screen

In my Angular application, I am using bootstrap to create the following structure (simplified version).

<div class="container">
    <div class="header>
        <div class="mat-card> 
             <!-- Header content -->
        </div>
    </div>
    <div class="row">
        <div class="col-8">
            <div class="mat-card> 
                <!-- Table content here -->
            </div>
        </div>
        <div class="col-4>
            <div class="mat-card> 
                <!-- Other content --> 
            </div>
        </div>
    </div>
</div>

The col-8 column in this structure will contain a mat-card with a table that may have a variable number of rows. If the table has many rows, it could exceed the page size and require scrolling to view all data.

I want to limit the col-8 column to use only the necessary space for the table, while still allowing it to expand based on the table's height. Additionally, I aim to set a maximum height for the col-8 column so it doesn't surpass the remaining vertical space on the page, making sure it stays within the browser window's height minus the header's height.

To recap:

  1. col-8 contains a dynamic-height table
  2. col-8 should adjust its height according to the table
  3. col-8 should not exceed the browser window's height

While setting the column's height to vh and adding overflow-y: scroll achieves part of the desired effect, it results in a fixed-height column and lacks responsiveness. It's a step in the right direction but not the complete solution.

Answer №1

Do you think using the CSS property max-height instead of height will make it more responsive?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing AngularFirestore to fetch a reference to a document within a collection and associate it with a specific class model

I'm exploring ways to merge two Firestore collections that are connected through a reference field. These are the two collections in question: https://i.sstatic.net/ARGHs.png In my userstory template, I aim to showcase the displayName of the referen ...

What is the best way to retrieve a specific field from the observable data stream?

When working with observables, I often find myself using them like this: ... const id = 1337; this.service.getThing(id).subscribe( suc => doSomething(suc.name), err = doSomethingElse() ); Lately, I've been utilizing the async pipe more freque ...

What is the lowest opacity value allowed in CSS?

When adjusting the opacity value of a button in CSS, I have noticed that even when the opacity is reduced to 0.005, the button remains clickable to some extent. However, when reducing the value to 0.000000000000000000000000000000000001, the button becomes ...

What is the best way to incorporate arrow buttons on my website in order to unveil various sections on the homepage?

A colleague and I are collaborating on a website for his cookery business. He has sketched out some design ideas on paper, one of which involves having a homepage with 4 different sections stacked on top of each other. Each section would have an arrow butt ...

Heres how you can define an index variable within a Primeng p-table similar to using ngFor

Seeking assistance to initialize an index variable like *ngFor="let d of sI.detail; let i = index" within my p-table <ng-template pTemplate="body" let-rowData > <tr class="text-center info"> <td&g ...

The functionality of two-way data binding seems to be malfunctioning within the directive

This is my first attempt at creating a directive in AngularJS and I am still learning the ropes. I'm currently experimenting with integrating Bootstrap Year Calendar with AngularJS. The Bootstrap Year Calendar is a jQuery plug-in designed to display ...

How can I integrate Cheerio.js into an Angular 6 application?

Recently, I embarked on a new Angular 6 project where I decided to incorporate Cheerio.js. To do so, I first ran the command: npm install cheerio Once I had successfully installed Cheerio.js, I proceeded to import it into my project and add it to the NgM ...

The dropdown for selecting months and years is not appearing on Angular 13's ngbdatepicker

Currently, I am developing a project in Angular 13 with Bootstrap 4. I am trying to implement a datePicker using ngbDatepicker, but unfortunately, the datePicker is not displaying the dropdowns for selecting months and years at the top. Here is the code sn ...

mobile-responsive vertical alignment using Bootstrap

Here is a jsbin that demonstrates the issue and here is the markup: <div class="row"> <div class="col-sm-4 xs-12"> <strong>UK Postcode</strong> </div> <div class="col-sm-4 xs-12"> <strong>Other Fie ...

I am attempting to create a multi-line tooltip for the mat-icon without displaying " " in the tooltip

I attempted to create a multiline tooltip using the example below. However, the \n is showing up in the tooltip. I am looking to add a line break like we would with an HTML tooltip. Check out the code here. ...

Enable a button or class to dynamically alter its color

Hi there! I'm new to coding and just started learning HTML and CSS. My question is: How can I change the color of buttons once they are clicked? <div class="icon-bar"> <a href="#"><i class="fa fa-search" ...

Content Division with Sticky Footer

I have successfully made my footer stay at the bottom of the page by following this method: Now, I am facing an issue where my #content div has borders on the left and right sides but does not expand to match the height of the #wrapper. Your help in reso ...

Leveraging services in Angular: accessing directly in view or via component

I am currently working on an application that consists of multiple pages, each with their own components. I have a single config.service.ts file where the debug mode is set as a boolean. Within my views, depending on this setting, I need to show buttons, ...

An issue is preventing the Angular 2+ http service from making the requested call to the server

I am looking to create a model class that can access services in Angular. Let's say I have the following endpoints: /book/:id /book/:id/author I want to use a service called BooksService to retrieve a list of Book instances. These instances should ...

How to detect a change in the value of a formControl during each focusout event in Angular 6?

Within a child component, I have an input variable called @Input which measures in Inches. My form consists of 2 input text controls - 1. Foot 2. Inches I convert the @Input to feet and inches accordingly. The requirement is that only if the values are cha ...

What is the best way to vertically center a button against a video using CSS?

How can I vertically center a button against a video using CSS? Here is my code: https://jsbin.com/curefoyefe/edit?html,css,js,output <video controls="" ng-show="myForm_live_video.live_video.$valid" ngf-src="live_video" width="200" height="200" class= ...

Identifying browser compatibility for date input type with Angular 2 and above

Is there a reliable method to check if the browser supports <input type="date"> in Angular2+? I came across a suggestion on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date where they recommend creating the input element and chec ...

Is it possible to change the hover highlight rotation on a link without affecting the surrounding elements?

Is it possible to rotate the highlight on a link when hovered? I'm new at this, so apologies if this question seems basic. This is how my css/html is currently structured: .links { display: block; } .links a { color: #000000; text-decoratio ...

Ensure that Angular CLI libraries contain all necessary dependencies

I'm currently facing a challenge with integrating Angular Material dependency into my custom library. The main application that references the custom library encounters an error stating "Cannot find @angular/material/core" and "@angular/material/tabs" ...

The class variable cannot access the Angular Http response returned by the service

I have a Typescript application built with Angular 2. In this application, I need to retrieve Build Artifacts from a Jenkins server using the Jenkins Rest API. The Build Artifact contains a text file that I want to read from. I am making use of Angular&apo ...