Large dynamically sized html table with a fixed scroll row and fixed scroll column

前端 未结 6 428
予麋鹿
予麋鹿 2020-11-30 21:25

I need to display a large table on a web page and need to prevent the first column and first row from scrolling. I\'d like to dynamically set the vertical

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 21:44

    If you don't like to use heavy loaded plugins you could do:

    Create a table with only the fixed table header

    Create a div with fixed width (remember the scrollbar width) and height and set scrolling Y direction. Within this div you place the body of the table.

    Create the 3th and last table and place the table below the div to make it look like 1 big table.

     HEADER 
    BODY
    (div is scrollable) Foot

    If you need to make changes dynamicly use bare javascript, you don't need to use jquery or other heavy plugin.

提交回复
热议问题