ColumnControl - inserted instead of in

ColumnControl - inserted instead of in

VynskirVynskir Posts: 6Questions: 3Answers: 0

Link to test case:
https://github.com/DataTables/ColumnControl/blame/a334ecc37062fa42250bf8684a9144ebcade0898/js/dataTables.columnControl.ts#L180

Description of problem:
Hello,

When importing ColumnControl in an app, all the table headers have td child elements instead of th, even when the extension is not enabled for a particular table.

Is this behavior expected ? Shouldn't the line linked above be rather:
tr.appendChild(createElement(isHeader ? 'th' : 'td')); ?

Best regards,
Thibault

Answers

  • allanallan Posts: 64,557Questions: 1Answers: 10,672 Site admin

    Hi Thibault,

    Thanks for your question. That's intentional - td is a valid tag to use in the thead row and I was generally expecting any rows in the ehader that are dynamically added to not be the header cells (more likely to be used for search boxes, which are not headers - there would likely be a th above them).

    On that assumption I think td is semantically the correct one to use.

    even when the extension is not enabled for a particular table.

    That statement bothers me though. ColumnControl shouldn't be doing anything on a table that it isn't enable for. Can you give me a link to a test case showing the issue so I can take a look into what is happening there please?

    Thanks,
    Allan

Sign In or Register to comment.