Hello.
I'm using the server - side processing and i need to put aligning data for TD. I need that exist parameter like DT_RowClass. But how can i use the aligning inside TD ???
i mean i need to apply the different classes to different separate cell. For example in one row i can apply a few classes to different cells. Also it will be convinnient to do it using server-side processing like with DT_RowClass.
I still don't see how sClass wouldn't work; if it's about convenience, it's the more convenient option in my eyes, rather than having to hack markup into the data. But that's just my opinion.
That failing—and possibly an even better-performing option—would be to do it with CSS. You should know in advance what your table is going to look like, so with CSS you can simply write a rule like:
[code]
td:nth-child(4n+1) { text-align: right }
[/code]
(you'll need to look up nth-child docs/tutorials to figure out exactly which rules to write)
No, i don't have how my table will look, bcs i use dataTables in the jsp and the number of columns depends on settings.
[code]
YTM BGHT%
PUR_ DATE
[/code]
so i don't know which columns i have and what classes i have to apply to cell, bcs it's depends on the settings. So i need to assign class to cell on the server side.
use one of the callbacks (i.e. fnRowCallback) and change classes. that callback will give you access to a DOM (as nRow). just iterate over the columns and see if you need to apply any CSS to any of the cells or the entire row.
Replies
Allan
That failing—and possibly an even better-performing option—would be to do it with CSS. You should know in advance what your table is going to look like, so with CSS you can simply write a rule like:
[code]
td:nth-child(4n+1) { text-align: right }
[/code]
(you'll need to look up nth-child docs/tutorials to figure out exactly which rules to write)
[code]
YTM BGHT%
PUR_ DATE
[/code]
so i don't know which columns i have and what classes i have to apply to cell, bcs it's depends on the settings. So i need to assign class to cell on the server side.
http://www.datatables.net/ref#fnRowCallback