change cell border after ajax call does not work

change cell border after ajax call does not work

alsaleemalsaleem Posts: 8Questions: 3Answers: 0
edited August 2019 in Free community support

I am tying to change the cell border after table update from ajax.
The cell background-color works but not border-color.
I used (fnRowCallback) & (createdRow) & (rowCallback) with :

$(row).addClass("cell-red"); // .cell-red { border-color: Red; border-width: 5px; }
$(row).css("border-color", "Red");

both do not work. however, when i change background color, both works.
I tried for a specific cell and whole row, but did not work either.

Thanks.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,734Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Seems to work here: http://live.datatables.net/woxanuca/2/edit .

    Allan

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Here's that example with background colour too: http://live.datatables.net/vipoyazo/1/edit

  • alsaleemalsaleem Posts: 8Questions: 3Answers: 0

    Great. The example was very helpful. Now I can set the border.
    It was actually the way I set the css.

    example $('td:eq(2)', row).css({ 'border': '1px solid red' });
    mine (equiv) : $('td:eq(2)', row).css("border", "1px solid red");

    I discovered also it works with double quote not single quote when I use addClass..

    Thanks for the help.

This discussion has been closed.