PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 2, 2022

[FIXED] How to add space between header and body table in Angular Material 13?

 August 02, 2022     angular, css, html, html-table     No comments   

Issue

How can I add space(margin) between header and body in a angular material table?

I tried at first with this solution but it didn't work.

demo: https://stackblitz.com/edit/angular-ivy-anphrw?file=src/app/app.component.html


Solution

What you have seen here can work.

You must add modifiers in order to apply the style to material elements such as :host and ::ng-deep.

Then don't forget to play with the line-height attribute to modify the space between header and body.

This can be controversial because of supposed future deprecation and similarity with !important but it works well, and while you know what you do, it's not a bad thing to use them in my opinion.

I have forked your stackblitz project with the modifiers.

And here is a course for those modifiers, to understand how and when to use them.



Answered By - Alexis
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing