phuocng / html-dom

Common tasks of managing HTML DOM with vanilla JavaScript. Give me 1 ⭐if it’s useful.
https://phuoc.ng/collection/html-dom
MIT License
6.51k stars 459 forks source link

Do you also have sticky table columns feature or script? #249

Open rajuaryan21 opened 1 year ago

rajuaryan21 commented 1 year ago

Hi,

imagine a scenario where you need to show 3 or 4 columns freeze while scrolling a big chunk of column data. You can have a sticky header or sticky columns and it can stick to left or right or both.

It would be nice to have such an HTML dom script in vanilla javascript. There are a few on jquery but many, including me, are big fans of using pure JavaScript.

Let me know if this is possible to include in your arsenal.

Thanks, Raj

rajuaryan21 commented 1 year ago

for reference, you can check this one: https://examples.bootstrap-table.com/#extensions/fixed-columns.html

rajuaryan21 commented 1 year ago

and this one also: https://mui.com/x/react-data-grid/column-ordering/

Here you see the menu items that pop up on clicking the three vertical dots in each table header column. It says pin to left or pin to right seems impressive.

elkarouani commented 1 year ago

Hi @rajuaryan21, I saw the example of bootstrap you provided, so first I think if it is possible using bootstrap it will be also possible using also just CSS, inspecting the example would help understanding how it works.