You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #668 introduced a way to specify the columns of a dataTable programmatically, so that you don't have to place them in your HTML. However, the markup it creates isn't correct as far as I can tell. You can see this in the example at http://dc-js.github.io/dc.js. The generated markup looks something like:
According to the HTML spec, the only permitted parent of th is tr; it shouldn't be a direct child of table. It's also good practice to put the tr inside a thead. Therefore, I think the generated markup should look like this instead:
I've worked around this by adding the following to my postRender and postRedraw hooks:
var headerGroup = $('<thead>').prependTo('#staff-table');
var headerRow = $('<tr>').appendTo(headerGroup);
$('#staff-table th').detach().appendTo(headerRow);
Without the workaround, things don't work right when I try to pass the DC dataTable into the jquery DataTable plugin, because the plugin can't detect the header row.
The text was updated successfully, but these errors were encountered:
PR #668 introduced a way to specify the columns of a dataTable programmatically, so that you don't have to place them in your HTML. However, the markup it creates isn't correct as far as I can tell. You can see this in the example at http://dc-js.github.io/dc.js. The generated markup looks something like:
According to the HTML spec, the only permitted parent of
th
istr
; it shouldn't be a direct child oftable
. It's also good practice to put thetr
inside athead
. Therefore, I think the generated markup should look like this instead:I've worked around this by adding the following to my
postRender
andpostRedraw
hooks:Without the workaround, things don't work right when I try to pass the DC dataTable into the jquery DataTable plugin, because the plugin can't detect the header row.
The text was updated successfully, but these errors were encountered: