Home > Net >  How to keep divs fixed while scrolling mouse with table?
How to keep divs fixed while scrolling mouse with table?

Time:08-29

Below I am trying to make the first 3 red divs fixed. I just wanted to scroll the table rows that are under these divs and have a scroll

Notice that when I scroll the divs that are in red, they go down too, but I didn't want that to happen.

I created symbolic values ​​just to illustrate this problem. Can anyone help to solve this problem?

I couldn't find a solution to this problem, even going into other forums and applying the same solution logic I still couldn't solve it

<!DOCTYPE html>
<html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    body {
      margin: 0;
    }

    .navbar {
      overflow: auto;
      background-color: blue;
      position: fixed;
      width: 100%;
      height: 700px;

      display: grid;
      grid-template-columns: repeat(3, 460px);
      grid-auto-rows: 300px ;
      grid-auto-flow: dense;
      grid-gap: 10px;
      padding: 10px;
      resize: horizontal;
    }

    .navbar div{
      border-radius: 10px;
      background-color: red;
    }
  </style>
</head>

<body>

  <div >
    <div></div>
    <div></div>
    <div></div>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
  </div>

</body>

</html>

CodePudding user response:

<!DOCTYPE html>
<html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    body {
      margin: 0;
      overflow: auto;
      position: relative;
    }

    .navbar {
      overflow: auto;
      background-color: blue;
      position: sticky;
      width: 100%;
      height: 700px;
      top:0;
      display: grid;
      grid-template-columns: repeat(3, 460px);
      grid-auto-rows: 300px ;
      grid-auto-flow: dense;
      grid-gap: 10px;
      padding: 10px;
      resize: horizontal;
    }

    .navbar div{
      border-radius: 10px;
    
      background-color: red;
    }
  </style>
</head>

<body>

  <div >
    <div></div>
    <div></div>
    <div></div>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
  </div>

</body>

</html>

CodePudding user response:

The new code would be:

.navbar div {
 position: sticky;
 top: 0;
} 

And in action:

body {
  margin: 0;
}

.navbar {
  overflow: auto;
  background-color: blue;
  position: fixed;
  width: 100%;
  height: 700px;
  display: grid;
  grid-template-columns: repeat(3, 460px);
  grid-auto-rows: 300px;
  grid-auto-flow: dense;
  grid-gap: 10px;
  padding: 10px;
  resize: horizontal;
}

.navbar div {
  border-radius: 10px;
  background-color: red;
  /*new code from here*/
  position: sticky;
  top: 0;
}
<!DOCTYPE html>
<html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>

  <div >
    <div></div>
    <div></div>
    <div></div>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
    </table>
  </div>

</body>

</html>

CodePudding user response:

Here you go:

   body {
      margin: 0;
    }

    main{
      overflow: auto;
      width: 100%;
      height: 700px;
      resize: horizontal;
    }
    table{
        border-collapse: collapse;
        width: 100%;
        height: 100%;
    }
    table tr:nth-child(even){background-color: #f2f2f2;}
    table tr:hover {background-color: #ddd;}
    table td, table th{
      border: 1px solid #ddd;
      padding: 8px;
    }
     table th{
      position: sticky;
      top:0;
      border: 1px solid white;
      padding-top: 12px;
      padding-bottom: 12px;
      text-align: left;
      background-color: #04AA6D;
      color: white;
    }
    nav{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    }
    nav div{
      border-radius: 10px;
      width: 100px;
      height: 100px;
      background-color: red;
    }
<!DOCTYPE html>
<html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
  <nav>
    <div></div>
    <div></div>
    <div></div>
  </nav>
  <main>
    <table>
        <th>col1</th>
        <th>col2</th>
        <th>col3</th>
        <th>col4</th>
        <th>col5</th>
        <th>col6</th>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>
        <tr>
          <td>val1</td>
          <td>val2</td>
          <td>val3</td>
          <td>val4</td>
          <td>val5</td>
          <td>val6</td>
        </tr>      
      </table>
  </main>

</body>

</html>

CodePudding user response:

<!DOCTYPE html>
<html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    html {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      padding: 0;
      overflow: hidden;
      position: relative;
    }
    .fixed-box {
      display: grid;
      grid-template-columns: repeat(3, 460px);
      grid-auto-rows: 100px;
      grid-gap: 10px;
      padding: 10px;
      position: fixed;
      top: 0;
      z-index: 1;
    }
    .fixed-box div{
      border-radius: 10px;
      width: 100%;
      background-color: red;
    }

    .navbar {
      overflow: auto;
      background-color: blue;
      display: grid;
      grid-template-columns: repeat(3, 460px);
      grid-auto-rows: 300px ;
      grid-auto-flow: dense;
      grid-gap: 10px;
      padding: 10px;
      resize: horizontal;
      
      position: relative;
      top: calc(100px   20px);
      width: 100%;
      height: 700px;
    }

  </style>
</head>

<body>

  <section >  
    <div></div>
    <div></div>
    <div></div>
  </section>
  <div >
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
    <table>
      <th>col1</th>
      <th>col2</th>
      <th>col3</th>
      <th>col4</th>
      <th>col5</th>
      <th>col6</th>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>
      <tr>
        <td>val1</td>
        <td>val2</td>
        <td>val3</td>
        <td>val4</td>
        <td>val5</td>
        <td>val6</td>
      </tr>      
    </table>
  </div>

</body>

</html>

CodePudding user response:

Simple you can Change position:absolute to position:fixed;

  • Related