Table With Horizontal Scroll - Possible to fix a column?


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

cdenby pro asked 6 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?


TonyO pro answered 6 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 } } ); } );


Marta Szymanska staff pro premium answered 6 years ago

Hi, cdenby,

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

Best, Marta


cdenby pro answered 6 years ago

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

Thanks.


Marta Szymanska staff pro premium commented 6 years ago

Ok, I understand.


itman answered 5 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 5 years ago

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


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
  • User: 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