Scrollable Table with Fixed Header

Hide the Scrollbar first

::-webkit-scrollbar { 
    display: none; 
}

Set the CSS of

Change the display property, so that the height and overflow-y can be configured.

Set the height, and add overflow-y to make the table body scrollable in a range.

tbody{
  display: inline-block; // or block
  height: 120px;
  width: 100%;  // Width follow the 
  overflow-y: auto;
}

Set the CSS of

, , we also need to configure the width of each row and each element in and .



, and

Because we change the display of

Title
Element

你可能感兴趣的:(Scrollable Table with Fixed Header)