Highlighting another cell on same row as specified value
Highlighting another cell on same row as specified value
I probably shouldn’t have asked this in another question so I’ve made it into a standalone question.
After finding the highest (or lowest) date I don’t want to put the marker in the same cell which $(this.node())
does. I’d like to change the style of the "Name" cell (column 1)?
Does anyone know how to change the example below so this.node
has the correct code for putting the red cross at the side of the name?
I’ve tried following examples of rows().nodes() and cells() with rowSelector/columnSelector to get the row with no luck.
This question has an accepted answers - jump to answer
Answers
You can do something like this: http://live.datatables.net/cokucuda/7/edit
We'll get back to you about how to get the crosses on the same line.
Colin
That's fantastic @colin It's exactly how I wanted it to work. I will actually be putting a CSS label under the content rather than having it appear after. I just used the "X" to make it simpler. If anyone wants it to appear after then changing the
<div>
to<span>
will do it.Can I ask whether it's possible to use an object name for the column rather than number (in this case 0)? I tried that (both in quotes and without) but it didn't work in my main project.
$(api.cell(this.node(), 0)
I must point out it's not that important, so I'm happy to stick with numbers.
That's the
column-selector
, and there are different ways to specify that (see the reference page),Colin