Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Table With Horizontal Scroll - Possible to fix a column?

cdenby pro asked 5 years ago


https://mdbootstrap.com/docs/jquery/tables/scroll/#datatable-horizontal-scroll That functionality is what I'm after, except that I'd like to have a column or two at the left with disabled horizontal scrolling. Basically, looking for Horizontal and Vertical Scrolling with a thead not scrollable and a left column not scrollable.

Is this possible?


itman free answered 4 years ago


Hi I'm looking for a solution to the same problem mentioned above and I tried TonyO solution but it didn't work. Is there another way?


Grzegorz Bujański staff commented 4 years ago

Unfortunately not. We don't know any other way.


cdenby pro answered 5 years ago


I ended up going with a jquery-freeze-table plug in from Nick Tsai

Thanks.


Marta Wierzbicka staff commented 5 years ago

Ok, I understand.


Marta Wierzbicka staff answered 5 years ago


Hi, cdenby,

have you checked TonyO's solution? Is it helpful for you?

Best, Marta


TonyO pro answered 5 years ago


To have fixed columns (or header rows) I've found adding this javascript helps provide additional scroll control:

$(document).ready(function() { var table = $('#example').DataTable( { scrollY: false,, scrollX: true, scrollCollapse: true, paging: false, fixedColumns: { leftColumns: 1, topRows: 1 } } ); } );



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.12
  • Device: PC
  • Browser: Chrome
  • OS: Win10
  • Provided sample code: No
  • Provided link: Yes
Tags