javascript - Datatables: How to add custom server-side styling? -
i'm using datatables on simple html table. table build server-side php script.
so build 'table' element 'thead' , 'tbody' in it, , apply datatables table element after page load.
previously (before using datables), customize styling of table setting specific class rows, cells, etc..
however seems when specifying custom class e.g.:
<tr class='mycustomclass'>
is overwritten when datatables applied it.
is there setting in datatables include custom classes? reading documentation there lot of styling options in datatables, far can find these javascript functions have executed client-side, if option styling datatables, quite difficult implement server-side styling depending on content of given row, cell, etc...
edit
example:
- ok: table (without datatables loader) 2nd row marked in red: http://jsfiddle.net/hedvf/1164/
- not ok: same table datatables loaded, no red border around 2nd row seen: http://jsfiddle.net/hedvf/1163/
note in both examples html source table has "style='border-color: red; border-style: solid" in 2nd 'tr' element, when loading datatables on table, red border not visible
so loading table html dynamically? if 'echoing' results, should place inline css properties along echo statement.
echo "<tr style='border:1px solid red>'" . $row['myrow'] . "</tr>";
Comments
Post a Comment