I need to align the text content in the header on left and right side of header tag. i tried different ideas, but none works for me. help me.
<div style="width: 40%">
<mat-card>
<mat-card-header class="card-container">
<mat-card-title class="card-container-right"> Test right</mat-card-title>
<mat-card-title class="card-container-left"> Test left</mat-card-title>
</mat-card-header>
<mat-card-content>
</mat-card-content>
</mat-card>
</div>
You can use what material design uses in mat-toolbar
in your .css
I am sorry, This doesn't work !!!!! Works in Mat-Toolbar, bat not in Mat-card Title.
Here is how it works, I knew I had used it somewhere
see : https://stackblitz.com/edit/angular-rb5vmu for working example
You can also do this if you want to continue to use the
mat-title
elements:See working StackBlitz Example
In your (I'll call it) example-card.component.html file
Then in your example-card.component.css
..and finally in your styles.css
The trick to this is overriding Angular materials
.mat-card-header-text
to be 100% the width of themat-card-header
. Otherwise it behaves like in inline element and only takes up the width of its children elements text. Preventing you from spacing them out.add custom css on .mat-card-header class