Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

584
Views
Why my datatable Fixed header doesn`t work /

I am trying to make my data table Thead a sticky one but when i tried fixed header than it doesn't work . I have tried position: fixed; , top: 0; and try to fix it with css but when a done this action than it works in firefox as expected but it doesn't work as expected in crome edge opera .

    "stateSave": false,
    "orderCellsTop": true,
    "fixedHeader": {
        header: true,
    },
    "columns": [
    {'data':'chk_select_header','orderable': false},

Here is my code of ajax .

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I had tried to fixed my thead here in my data table . But this data table fixed that thead to the top of there page like this https://datatables.net/extensions/fixedheader/examples/options/simple.html but i wanted to make sticky to that data table div . i found only way to do it is using this below CSS method

thead tr:first-child Th {
position: sticky;
z-index: 12;
top: 0;
background: white;

}

thead Th {
    position: sticky;
    z-index: 12;
    top: 51px;
    background: white;
}

This is the simplest method to sticky your data table header to the table head

over 4 years ago · Santiago Trujillo Report

0

Why don't you try fixing your thead th using position: sticky for th .

thead Th {
position: sticky;
z-index: 1;
top: 0;
}
over 4 years ago · Santiago Trujillo Report

0

FixedHeader, a datatables extension, can either be:

  • downloaded in bundle here: in download builder; or
  • it can be included on your page as individual files ref. here. Files for FixedHeader : CSS, JS

This functionality is inbuilt in the extension, nothing separate needs to be done with CSS etc. Here is how it is initialized:

$('#myTable').DataTable( {
    fixedHeader: true
} );

Or, after datatable has been constructed, it can be added using new keyword with the $.fn.dataTable.FixedHeader function:

var table = $('#myTable').DataTable();
new $.fn.dataTable.FixedHeader( table, {
    // more options
} );
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!