No access to page, and tables don't have thead - Assume first is thead mode?
No access to page, and tables don't have thead - Assume first is thead mode?
gishnetwork
Posts: 7Questions: 0Answers: 0
In instances where one does not have access to the table code, but can reach in with jQuery, why is there no "Assume the first set is actually the THEAD"?
It seems so simple. Like
AssumeFirst: yes
No?
It seems so simple. Like
AssumeFirst: yes
No?
This discussion has been closed.
Replies
Having said that, it is very easy to use a couple of lines of jQuery to manipulate the DOM:
[code]
// Create a THEAD and move the first row into it
$('#example').append( 'thead' );
$('#example thead').append( $('#example tbody tr:eq(0)') );
// ... initialise DataTables
[/code]
(assumes you have a tbody of course :-) ).
Allan
There are a lot of non DT ways to accomplish things that DT can do. It's seems arbitrary for DT to have on it's list of prerequisites something that DT could handle if it wanted to, chopping off a prerequisite and/or workaround. I am not saying one should not code in a thead/th. Just saying it seems odd that there are cases where one would need to use jQuery to accomplish something explicitly to allow DT to even work.
I really do think there are a lot of older large industry vendors who have tech that was coded 98 - 2005 that in most cases does not have a thead. I should say think - I know, because I am dealing with one that has a crapton of clients. These are vendors that move like molasses, but are not in a sexy industry that is attracting younger developers, so the UX/UI, and proper coding is left behind.
Anyway, food for thought.