Center align content in data grid #605
-
Beta Was this translation helpful? Give feedback.
Answered by
nzbin
Nov 2, 2023
Replies: 2 comments
-
Define a class for some columns. columns = [
{
header: 'Counter Number',
field: 'counterDetails.CounterNo',
class: (data) => {
if (data == null) {
return 'text-center'; // <= define a class
} else {
return data.counterDetails.CounterNo == 'Not Assigned' ? 'warning' : '';
}
},
minWidth: 100,
width: '100px',
},
...
]; Then modify the CSS styles for the .text-center .mat-header-cell-inner {
justify-content: center;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rahulpd101
-
I have published a new version - .text-center .mat-header-cell-inner {
- justify-content: center;
- } |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Define a class for some columns.
Then modify the CSS styles for the
mtx-grid
.