Organizing an angular expansion panel

I am currently dealing with an expansion panel that has a lot of content. The layout is quite messy and chaotic, as seen here:

https://ibb.co/Y3z9gdf

It doesn't look very appealing, so I'm wondering if there is a way to organize it better or maybe display it in a list format?

Here's my code snippet:

<div id="persontyp">
            <mat-expansion-panel > 

                <mat-expansion-panel-header  > Personentypen </mat-expansion-panel-header>
                    <mat-checkbox *ngFor="let type of allpersonTypes" [value]="type.bezeichnung">
                        {{type.bezeichnung}}
                    </mat-checkbox>
            </mat-expansion-panel>
        </div>

This is my CSS:

mat-expansion-panel{
    padding: 5px;
    width: 400px;
}

Answer №1

mat-checkbox {
    display: block;
}

This solution should meet your needs. Alternatively, you can add !important to the display: block; property.

By using the following code, you can separate it into 2 columns:

<div id="persontyp">
  <mat-expansion-panel > 

      <mat-expansion-panel-header  > Personentypen </mat-expansion-panel-header>
      <div class="list-container">
        <mat-checkbox *ngFor="let type of allpersonTypes" [value]="type.bezeichnung">
            {{type.bezeichnung}}
        </mat-checkbox>
      </div>
  </mat-expansion-panel>
</div>

and for the CSS styling:

.list-container {
  display: grid;
  grid-template-columns: auto auto;
}

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

What benefits does WebSocketSubject offer?

New to the world of web development, so please be patient with me... Current tech stack: Angular frontend, Tornado (Python-based) web server for the backend I've been successfully utilizing RxJs and WebSocket to communicate with the backend, followi ...

Design a unique div in the style of Google

How to Position User Data in Front of Profile Image I am currently struggling with positioning the user data in front of the profile image (the round one with the letter). I have shared my code below: <div class="conta"> <p>Logg ...

Introducing the latest Angular quickstart seed, now with updated dependencies to avoid npm warnings such as the deprecated [email protected

Embarking on my journey with node.js, npm, and Angular has been quite the learning curve. I am currently in the process of setting up a new Angular 2 project using their provided quickstart seed. I'm diligently following the instructions for local de ...

Shade the tag when the checkbox is marked

Is it possible to change the color of a label without using javascript when the associated checkbox is checked? ...

Using Node.js and Less to dynamically select a stylesheet source depending on the subdomain

Currently, my tech stack consists of nodejs, express, jade, and less. I have set up routing to different subdomains (for example: college1.domain.com, college2.domain.com). Each college has its own unique stylesheet. I am looking for a way to selectively ...

Issues with a top navigation bar

I'm currently working on customizing a header menu to my liking but have limited experience with CSS. The header menu consists of two main items, each with a dropdown. I envision the first menu item to look like this upon hover: And for the second m ...

Apply SetTimeout exclusively for desktop devices

A website I'm working on has a background video from YouTube using YTPlayer. To enhance the user experience, I have implemented a CSS spinner that displays while the page is loading. However, I noticed that the spinner disappears before the video fini ...

When utilized in a nested component, the service is found to be null

When developing a nested component, I encounter an issue where the injected service is null. How can I successfully use a service in a nested component? export class ActivityComponent implements OnInit { constructor( . . public accountServ ...

An issue occurred when clicking on a line due to the filter

Issue at Hand: Currently, I am facing a problem where selecting an item from the list by clicking on the button leads me to access the information of a different item when the filter is applied. Desired Outcome: I wish to be able to access the correct inf ...

Angular - Creating validations for numeric input fields within reactive forms to ensure values fall within a designated range

One issue I am facing in my Angular form is with a numeric input field. The requirement is to set the minimum value as 3 and the maximum value as 10. However, upon loading the form, the default value should be 0. Users are expected to enter values ranging ...

Using Angular 2's ngModel directive to bind a value passed in from an

Using [(ngModel)] in my child component with a string passed from the parent via @Input() is causing some issues. Although the string is successfully passed from the parent to the child, any changes made to it within the child component do not reflect bac ...

The top margin in CSS relative positioning is not being displayed

My client has a specific requirement for the webpage to be positioned in the center of the screen. To achieve this, I have enclosed the entire webpage within a div element called "mainpage". Here is the CSS code: #mainpage { position:relative; wi ...

Quantify the Proportion of Affirmative/Negative Responses and

I am attempting to calculate the percentage of "Yes" or "No" responses in an HTML table based on user input for each month's questions. Then, I want to display the average percentage in the "average" column for each month. For example, if the user sel ...

Encountering a d3.js runtime issue following the transition to Angular 8

I've been experimenting with upgrading my Angular 6 application to Angular 8. It compiles fine, but I'm facing a runtime error as soon as it runs: "d3.js:8 Uncaught TypeError: Cannot read property 'document' of undefined". The specific ...

A sleek CSS text link for a stylish video carousel

I am attempting to create a CSS-only text link to video slider within our Umbraco CMS. Due to the limitations of TinyMCE WYSIWYG, I am restricted in the amount of code I can use as it will strip out most of it. So far, I have developed a basic CSS slider ...

The Angular Behaviour Subject is failing to accurately represent the change status within the component

I am currently working on a MEAN project that involves an Angular Behaviour Subject emitting the status of the logged-in user. Issue: After the user logs in, the app component detects the change in user status. However, the header component (which is part ...

TensorflowJS Error: The property 'fetch' cannot be read as it is undefined

I am working on an Angular 7 application and attempting to load the mobilenet model by following the instructions in this example. To do this, I first installed tensorflowjs using the command npm install @tensorflow/tfjs (based on the steps provided in th ...

Issue with static resource fetching when referencing a .js file within an HTML document while using Flask

My HTML file loads my OpenLayers JavaScript file (which displays a map frame) when opened directly. However, when running the HTML from my Flask python app, the JavaScript file/object fails to load (resulting in no map display, just some heading text). I ...

How come my image is not aligned to the right of the header in my HTML code?

My attempt to align an image to the right side of my heading using code was unsuccessful. Here is the HTML snippet I used: /* Aligning with CSS */ #colorlib-logo img { display: flex; align-items: center; width: 30px; height: 30px; } #colorli ...

Highlighting a specific list item dynamically without affecting its nested children

While I have come across similar questions, they don't quite address the specific issue I'm facing. My current project involves creating a keyboard-accessible tree widget. My goal is to apply a background color to the selected list item without ...