Scrollable HTML table with top row and left column frozen

前端 未结 5 1021
生来不讨喜
生来不讨喜 2020-12-09 12:07

Has anyone been able to implement a scrollable table in HTML where the TOP row and LEFT columns are frozen, but the rest of the table is scrollable? A perfect example of th

5条回答
  •  情深已故
    2020-12-09 12:15

    Go with a basic structure like this-

    table
      row
        column (blank)
        column
          table (1 row high, column headers)
      row
        column 
          table (1 column wide, row headers)
        column
          div (fixed height & width, overflow auto)
            table (actual data)
    

    Set a fixed table-layout and specify column widths in pixels explicitly. You should be able to achieve the same effect.

提交回复
热议问题