Missing `dt-type` classes on `th` and `td` elements for server-side implementations
Missing `dt-type` classes on `th` and `td` elements for server-side implementations
nanone
Posts: 2Questions: 1Answers: 0
Link to test case: https://datatables.net/examples/server_side/post.html
Description of problem:
After skimming through a bunch of the examples I've narrowed down the problem to what seems to be "server-side":
- All "server-side" examples initially render datatables
<th>
and<td>
elements withoutdt-type
classes. The initial alignment is therefore incorrect. - If the user sorts one of the columns, the
<th>
element will get adt-type
class, but the corresponding<td>
elements will not, therefore leading to a visually worse misalginment between header and colums cells.
Let's take 2 examples, one "server-side" and one other one type, where we will both look at the Salary
column.
-
- Here on first load we can see that the
<th>
element for theSalary
field has classesdt-orderable-asc dt-orderable-desc
. The<td>
elements under this column have no classes. - If we start to sort the column once, we see that
<th>
element has the classesdt-orderable-asc dt-orderable-desc dt-type-numeric dt-ordering-asc
, but the underlying<td>
element only has a sorting classsorting_1
. - The result: misalignment between
<th>
and<td>
elements for this column.
- Here on first load we can see that the
-
- Here on first load we can see that the
<th>
element for theSalary
field has classesdt-orderable-asc dt-orderable-desc dt-type-numeric
. The<td> elements under this column have
dt-type-numeric` classes. - If we start to sort the column once, we see that
<th>
element has the classesdt-orderable-asc dt-orderable-desc dt-type-numeric dt-ordering-asc
, and the underlying<td>
element havedt-type-numeric sorting_1
classes. - The result: correct alignment between
<th>
and<td>
elements for this column.
- Here on first load we can see that the
I hope this is enough information to further debug the problem.