flexLayout container with maximum width

I am struggling to make a form occupy the entire screen width, adjacent to the left. I have tried various methods like setting width to 100%, using fxFlexFill, fxLayout and fxFlexs but couldn't achieve the desired result. Maybe I am implementing them incorrectly.

Calendar page:

<form [formGroup]="userForm" (ngSubmit)="sendRequest()">
  <div fxLayout="row" style="background-color: white">
    <div fxLayout="column" fxFlex="10">
      <mat-form-field appearance="fill">
        <mat-label>Date</mat-label>
        <input
          matInput
          #pick
          [matDatepicker]="picker"
          (dateInput)="OnDateChange(pick)"
          [min]="todayDate"
          [max]="maxDate"
          readonly
        />
        <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
        <mat-datepicker touchUi #picker [startAt]="todayDate"></mat-datepicker>
      </mat-form-field>
    </div>
    <div fxLayout="column" fxFlex="15"></div>
    <div fxLayout="column" fxFlex="30">
      <mat-form-field appearance="fill">
        <mat-label>Name</mat-label>
        <input matInput formControlName="firstName" />
      </mat-form-field>
    </div>
    <div fxLayout="column" fxFlex="15"></div>
    <div fxLayout="column" fxFlex="30">
      <mat-form-field appearance="fill">
        <mat-label>Phone Number</mat-label>
        <input matInput formControlName="phone" />
      </mat-form-field>
    </div>

    <div></div>
  </div>
  <div fxLayout="row">
    <table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
      <!-- hour Column -->
      <ng-container matColumnDef="hour">
        <th mat-header-cell *matHeaderCellDef>hour(90 min)</th>
        <td mat-cell *matCellDef="let element">{{ element.hour }}</td>
      </ng-container>
      <!-- Position Column -->
      <ng-container matColumnDef="position">
        <th mat-header-cell *matHeaderCellDef>No.</th>
        <td mat-cell *matCellDef="let element">{{ element.position }}</td>
      </ng-container>

      <!-- Checkbox Column -->
      <ng-container matColumnDef="select">
        <th mat-header-cell *matHeaderCellDef></th>
        <td mat-cell *matCellDef="let row">
          <mat-checkbox
            (click)="$event.stopPropagation()"
            *ngIf="row.statu == 'Open'"
            (change)="$event ? selection.toggle(row) : null"
            [checked]="selection.isSelected(row)"
          >
          </mat-checkbox>
        </td>
      </ng-container>

      <!-- statu Column -->
      <ng-container matColumnDef="statu">
        <th mat-header-cell *matHeaderCellDef>status</th>
        <td mat-cell *matCellDef="let element">{{ element.statu }}</td>
      </ng-container>

      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
      <tr
        mat-row
        *matRowDef="let row; columns: displayedColumns"
        (click)="selection.toggle(row)"
      ></tr>
    </table>
  </div>

  <div>
    <button mat-raised-button class="my-class" type="submit" color="accent">
      Send
    </button>
  </div>
</form>

Calendar page CSS:

table {
  width: 100%;
}
.example-form .mat-form-field + .mat-form-field {
  margin-left: 8px;
}
.my-class{
  margin-top: 10px;
  width: 100%!important;

}
.mat-form-field-empty.mat-form-field-label {
  color: green;
}
.mat-form-field-underline {
  background-color: green;
}

https://i.sstatic.net/hkHtP.png

Answer №1

Is it necessary for the entire screen to be filled with content? In order for the three input fields to expand all the way to the right, you may want to consider adjusting

<div fxLayout="row" style="background-color: white">

to 

<div fxLayout="row" id="row" style="background-color: white; display: flex">

Answer №2

Perhaps this resource can assist you:

The message conveyed was : "Utilizing 'fxFill' to occupy the entire width and height of the container element"

In essence ... it is imperative for the parent size to be set at 100%.

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

Challenge with AngularJS ng-select and ng-switch-when functionality

Struggling with implementing a selection menu on my angular charts, I encountered some challenges. The selection app template I used only displays the selection menu and graph axis on the page. Checking the console log for errors, I noticed one src URL wa ...

Adding an external JavaScript library to a gateway project: A step-by-step guide

I've been attempting to integrate the Simpl5 JavaScript library into my gateway, but I have encountered some issues. I placed SIPml-api.js and SIPml.js in the webapp/content/scripts directory. In .angular-cli.json, I updated the scripts array as follo ...

stopping a float-left div from being pushed down by a table

I am facing an issue with two float:left divs that are supposed to stack left-to-right. One div is a fixed width left nav, while the other should span the remaining width of the browser. The problem arises when there is a table in the second div with multi ...

A guide on incorporating Bootstrap 5 modal into an Angular project

I have added bootstrap 5 to my index.html file <link href="assets/css/bootstrap.min.css" rel="stylesheet" media="screen"> I attempted to implement the code from Bootstrap documentation on my Angular page, but it's not functioning correctly. ...

Eliminating the dynamic element in jQuery causes disruption to the ViewContainerRef container

In my Angular 2+ application, I am dynamically creating components using the following code snippet: @ViewChild("containerNode", { read: ViewContainerRef }) cardContainer; const factory = this.ComponentFactoryResolver.resolveComponentFactory(CardComponen ...

Specific height of a table row <tr>

I'm having difficulty setting a PRECISE height on an html table row. https://i.sstatic.net/5mP39.png The left column consists of two divs, each with a height of 44px, while the right column contains the table. The height of each row is set to 44px, ...

Issue with Cross-Origin Resource Sharing (CORS) in Angular 16 and

I have two Angular applications using Angular 16 and module federation - one for the MFE app and the other for the shell app. Everything works fine on localhost, but when I deployed the apps to different domains: for the MFE and for the shell app, I enco ...

When is it appropriate to utilize the produced HTML code?

Imagine a scenario with a template structured like this: <a id="registerLink" *ngIf="!isLoggedIn" #registercontainer>Login</a> Underneath, we have the following component: @ViewChild('registercontainer') registercontainer: ElementR ...

Steps to create a clickable row with color change in Angular 4

How do I make an entire row clickable and change the row color when a checkbox is clicked? This is my HTML file: <section class="others"> <div class="sub-header">Others</div> <p class="text-center" *ngIf="otherTests.length === 0"> ...

Attempting to insert visuals into a product catalog within a table

As I work on my final school project, a functioning webshop, I've been making good progress. However, I've hit a roadblock when it comes to adding images to a table in PHP. In my setup, I have two PHP files that are interconnected: products.php h ...

Adding Meta tags specifically for each page

Running a Laravel 5.4 project, we have a setup where each page needs unique META tags for accurate display when sharing URLs on social media platforms. My query is: How can I insert the following code into the head section of my pages? For instance, an a ...

The Jquery function for setting the active navigation tab based on the URL is currently over-selecting and choosing more options

I have a customized Jquery function that assigns the 'active' class to my navigation anchors based on the URL. While this function generally works, the issue arises when tab 1 is active - tabs 10, 11, and 12 also get marked as active. The code s ...

Executing unique calculations on Kendo UI Grid Columns

For experienced users, this may seem simple, but as a newcomer, I'm struggling with a basic arithmetic task. I want to multiply one of the column values (DealValue) by 0.05 in my Kendo grid setup. Despite looking through the Kendo docs, I couldn' ...

Using Webflow code in ReactJS/NextJS: Best practices and implementation tips

After exporting my Webflow code to my NextJS app, I noticed that many of the HTML tags are being flagged as errors because they appear to be missing closing tags. Can anyone shed some light on why this is happening and suggest potential solutions? It&apos ...

Assuming control value accessor - redirecting attention

import { Component, Input, forwardRef, OnChanges } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; @Component({ selector: 'formatted-currency-input', templateUrl: '../v ...

The browser has overridden the content length

While attempting to upload a file through a put call, I encountered an issue with the Content Range not matching the total number of bytes specified by the API. When I tried to manually set the content length, I received an error stating "Refused to set un ...

Utilizing intricate CSS selectors for integration testing with webdriverjs

In my quest to develop integration tests using Selenium with JavaScript bindings, WebdriverJS, Mocha, and Chai, I stumbled across an interesting suggestion in this article. It proposed using WebdriverJS over the official SeleniumJS bindings for some reason ...

Is there a way to incorporate ellipsis for text that overflows in the AntDesign Table component?

Issue: While working with AntDesign's Table component, I have successfully set the width of each cell. However, I am facing a challenge with text overflow as I would like the overflowing text to be truncated and displayed with an ellipsis. My ultimate ...

Achieving full child div coverage within a bordered parent div on Chrome

I am encountering an issue where I am trying to insert an image into a bordered div, but in Chrome 96.0 there are unexpected margins appearing from the top and left that I cannot seem to remove. Below is the code I am using: .wrapper { width: 36px; ...

JavaScript 12-hour Clock Displaying 24-hour Format with AM/PM Error

I am using JavaScript to display a 12-hour digital clock that updates continuously. However, the code I found online resulted in a 24-hour clock and incorrect am/pm output. Currently, it displays 13:33 am. I have experimented with various code snippets, in ...