CSS Sticky overflow scroll

by amindunited

HTML

<!-- SOF Page Div -->
<div class="page">
      <h1>
        Some Banner
      </h1>

  <!-- SOF Container Div
    This is the Div that centers the content on the page, and sets the Left/right Margins
  -->
  <div class="container">
    <div class="section">
      <h1>
        A title
      </h1>
      <table class="fixed_table">
        <thead>
          <tr>
            <th>Col 1</th>
            <th>Col 2</th>
            <th>Col 3</th>
            <th>Col 4</th>
            <th>Col 5</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>row 1-0</td>
            <td>row 1-1</td>
            <td>row 1-2</td>
            <td>row 1-3</td>
            <td>row 1-4</td>
          </tr>
          <tr>
            <td>row 2-0</td>
            <td>row 2-1</td>
            <td>row 2-2</td>
            <td>row 2-3</td>
            <td>row 2-4</td>
          </tr>
          <tr>
            <td>row 3-0</td>
            <td>row 3-1</td>
            <td>row 3-2</td>
            <td>row 3-3</td>
            <td>row 3-4</td>
          </tr>
          <tr>
            <td>row 4-0</td>
            <td>row 4-1</td>
            <td>row 4-2</td>
            <td>row 4-3</td>
            <td>row 4-4</td>
          </tr>
          <tr>
            <td>row 5-0</td>
            <td>row 5-1</td>
            <td>row 5-2</td>
            <td>row 5-3</td>
            <td>row 5-4</td>
          </tr>
          <tr>
            <td>row 6-0</td>
            <td>row 6-1</td>
            <td>row 6-2</td>
            <td>row 6-3</td>
            <td>row 6-4</td>
          </tr>
          <tr>
            <td>row 7-0</td>
            <td>row 7-1</td>
            <td>row 7-2</td>
            <td>row 7-3</td>
            <td>row 7-4</td>
          </tr>
          <tr>
            <td>row 8-0</td>
            <td>row 8-1</td>
            <td>row 8-2</td>
            <td>row 8-3</td>
            <td>row 8-4</td>
          </tr>
          <tr>
            <td>row...

CSS

html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  background-color: #e8e8e8;
  padding: 0;
  margin: 0;
}

.page {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
}

.container {
  background-color: #ffffff;
  width: 800px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: scroll;
  overflow-y: visible;
  height: 100vh;
}

td, th {
  padding: 0.5rem;
  min-width: 20vw;
}

.fixed_table thead {
  color: white;
  background-color: black;
}

table > thead, table > thead > tr > th {
  top: 0;
  position: -webkit-sticky;
  position: sticky;
  z-index: 1;
}