Remove the sort arrous
Remove the sort arrous
I want to remove the sort arrows from my table.
I have looked at the info at https://datatables.net/forums/discussion/comment/200892/#Comment_200892 and tried them all, but the sort arrows still show up for me.
I am using DataTables-1.11.3
I want to remove the sort arrows in the column headers.
I have tried
"ordering": 'false',
and
"order": [],
I have tried them both together.
I have tried the CSS in the link above.
I have tried
.no-sort::after { display: none!important; }
.no-sort { pointer-events: none!important; cursor: default!important; }
and added the class to the column
<th class="no-sort">
Any help would be appreciated.
Answers
Setting
ordering
to false works in this test case with 1.11.3:https://live.datatables.net/lewomuvu/1/edit
If this doesn't help then please post a link to a test case replicating the issue. Feel free to update my test case.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Kevin,
ordering: false,
turns off ordering all together. I just want to hide the arrows, I don't want the arrows. I got it to work using the CSS already on the post I referenced. I had to use the one you posted and the one from @awariat together.
this works and I can still order like this :
"order": [[ 0, 'desc' ]],
Is there an easier way in later versions?
thanks
For DataTables 2+
You might want to add styles to remove the padding as well if you like.
Allan
This works for older data tables versions. Just tested it.
I tried @allan and @rf1234 ... neither worked for me.
I'll keep using what I posted above.
thanks
Here is a live example with DT 2: https://live.datatables.net/tegihupi/1/edit .