简体   繁体   中英

Can't center column header for a sortable column in a mat-table

I have a mat-table with a sortable column like this but I can't center the column headers from my css file. I can do it in the browser debugger!

I tried this below in the css file with no luck, but it works when I modify it in the debugger.

.mat-sort-header-container {
   justify-content: center !important;
 }

Any help would be appreciated!

Try this

th.mat-header-cell {
    text-align: center !important;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM