我已经尝试了我能想到的一切来让这个工作。我修改了一个不同的stackblitz来添加这个作为测试:
https://stackblitz.com/edit/angular-acdxje-8bz7tq?file=app%2Ftable-basic-example.html,app%2Ftable-basic-example.css,styles.css,app%2Ftable-basic-example.ts
我正在使用的代码:
<mat-expansion-panel [expanded]="Expand" style="width: 80%; text-align: center">
<mat-expansion-panel-header>
<mat-panel-title style="text-align: center"> Test </mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
任何帮助将不胜感激!
2条答案
按热度按时间5t7ly7z51#
将
text-align: center
替换为margin: 0 auto
sy5wg1nm2#
我只是快速检查了代码,发现头文件使用了flex