-
Notifications
You must be signed in to change notification settings - Fork 37
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
Individual Column alignment #62
Comments
Hi @shopno111, you can use CSS to achieve what you want. Just add this snippet somewhere where your table is being rendered: /* Targets the head `th` and the body `td` */
.rsdt th, .rsdt td {
/* You you only need the !important rule if you're overriding some other CSS */
text-align: right !important;
} You can always use the |
as your way it will be all column, I want to do specific column only. Example : Here Name, Phone, Email, Date will be Left Alignment & Amount will be Right Column In your Headers, if we can do following way, it will be fetter amount: { headerClass = to styling table header part (th) If we can use custom class in there it will be good |
If you know the position of the columns, you can also target that using CSS and the nth-of-type selector. For example: /* Align the 3rd column's content to the right */
.rsdt th:nth-of-type(3), .rsdt td:nth-of-type(3) {
text-align: right !important;
} Though I understand the limitation. I'm considering adding a data attribute to the column (header and body rows) which you can then use to easily target using CSS: /* Align the `amount` column's content to the right */
.rsdt th[data-column-name='amount'], .rsdt td[data-column-name='amount'] {
text-align: right !important;
} |
Expected Behavior
Can we use specific alignment ?, if yes, then how we can do that.
Suppose I want to do right align in right with header and data .
The text was updated successfully, but these errors were encountered: