(Go: >> BACK << -|- >> HOME <<)

Column widths incorrect with rowgroups in dt v2

Column widths incorrect with rowgroups in dt v2

Andrew_NZAndrew_NZ Posts: 3Questions: 2Answers: 0

https://codepen.io/Andrew-Maxwell/pen/wvZXaYm
Using dt version 2.0.3 with rowGroup and scrollX ignores any column widths and gives all available width to the first column. rolling back to dt version 1.13.4 works fine

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,211Questions: 1Answers: 10,205 Site admin
    Answer ✓

    Unfortunately this is a known issue when the first row in the table contains a colspan attribute for a cell. I'll looking into workarounds. I think it is a browser bug, but they all do it, so I need to understand a little more about what they are doing and how to workaround it.

    Allan

  • jhammerjhammer Posts: 2Questions: 0Answers: 0

    Is there any solution to this? We are having the same issue on 2.0.7.

  • kthorngrenkthorngren Posts: 20,545Questions: 26Answers: 4,818

    Here is a more recent thread with the same question. Allan is still researching the issue.

    Kevin

  • jhammerjhammer Posts: 2Questions: 0Answers: 0

    @allan @kthorngren as a work around until solution is determined, we are adding a blank zero height row at the top of the table:

    "drawCallback": function (settings) {
        //add blank zero-height row at top for rowGroup rowspan issue fix
        var numCols = $(".dt-scroll-head table thead th").length;
        var cellHtml = "<td></td>";
        $(".dt-scroll-body table tbody").prepend("<tr class=\"zeroheight\">" + cellHtml.repeat(numCols) + "</tr>");
    }
    
Sign In or Register to comment.