Aligning columns
Aligning columns
paulsperanza
Posts: 6Questions: 0Answers: 0
Is there a way to set the alignment on a column? I don't think that I saq one in the docs.
Thanks
Thanks
This discussion has been closed.
Replies
The best way to do something like this is through a class style. If you just apply a class name to each cell in that column, then you can align the information as required (text-align:center; for example).
So if you are reading your table information from the DOM any classes there will be maintained (see the example on the home page - http://datatables.net/index - for this). Alternatively, you can ask DataTables to apply a class to a column using 'sClass': http://datatables.net/usage#sClass
Hope this helps,
Allan
I used the sClass. I was going to do this anyway but I wanted to be sure i wasn't missing some property for the columns. You have done a great job with this. I am shaking it out but so far I think it is the best JQuery grid out there.
I work with .Net and I was thinking of extending their Gridview control to wrap DataTables. The only problem is that you have so many options it might take me forever to do it :0) It may just be easier to set up the script by hand.
Keep up the great work.
Paul
I've used nth column css trick for this.<br>
//6th column is my currency column, which needs to be right aligned<br>