-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable Column's header text does not align in v.3.3.0 #1016
Comments
Seems to be the same problem using 3.11.0 also... |
Much has changed I think and DataTable employs flexbox. Thus, at least in my setup, I can format the column via :style="{'justify-content':'flex-end'}" which works for both, the body and the header cells. |
I tried with |
@cagataycivici it's not fixed. I believe flex inheritance makes the trouble. |
@sbscan I don't think changing global styles is a good idea. It may lead to unexpected results when more complex headers with filters are used. Instead I add .align-right{
text-align:right;
}
.align-center{
text-align:center;
}
.p-datatable th[class*="align-"] .p-column-header-content {
display: inline-flex ;
} I think this is much more convenient. |
We had to use the above CSS hack and justify-content: center rather than being able to apply a headerClass. That got the content to center but feels a bit hacky. |
I using 3.15.0. Don't align |
I have the same problem with 3.15.0, is there any workaround to align center for table column header? |
Same here |
same for me |
|
|
worked for me!! thanks |
This will not work for a sortable table, as it "pushes" the sort icon away |
This worked for me, but based on the obvious fragility of these hacks it really should be added as a built-in option. |
Seems to do the trick in v4. |
DataTable Column's header text does not align in v.3.3.0
'center' and 'right' ignored, text always stays on the left side.
code examples
This is regression from v.3.2.4 and before.
The text was updated successfully, but these errors were encountered: