title: how do i make the the header of my table sticky?
body: <p>have a table that can become come very long on the page so the header gets lost and so I thought a sticky header would fix that. You scroll down too far and the header is still there to let you know what the fields are.</p>
  <p>I tried everything but it doesn't work</p>
  <p>I hope you guys can help me. I will share the original code without me experimenting on it.</p>
  <p>note html is long because it has test data.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>@import "https://fonts.googleapis.com/css?family=Montserrat:300,400,700";
  .rwd-table {
      margin: 1em 0;
      min-width: 300px;
      width: 100%;
  }
  .rwd-table .table_header{
      overflow: hidden;
      position: relative;
      overflow-x: auto;
  }
  .rwd-table tr {
      border-top: 1px solid #ddd;
      border-bottom: 1px solid #ddd;
  }
  .rwd-table th {
      display: none;
  }
  .rwd-table td {
      display: block;
  }
  .rwd-table td:first-child {
      padding-top: .5em;
  }
  .rwd-table td:last-child {
      padding-bottom: .5em;
  }
  .rwd-table td:before {
      content: attr(data-th) ": ";
      font-weight: bold;
      width: 6.5em;
      display: inline-block;
  }
  @media (min-width: 480px) {
      .rwd-table td:before {
          display: none;
      }
  }
  .rwd-table th, .rwd-table td {
      text-align: left;
  }
  @media (min-width: 480px) {
      .rwd-table th, .rwd-table td {
          display: table-cell;
          padding: .25em .5em;
      }
      .rwd-table th:first-child, .rwd-table td:first-child {
          padding-left: 0;
      }
      .rwd-table th:last-child, .rwd-table td:last-child {
          padding-right: 0;
      }
  }
  
  
  h1 {
      font-weight: normal;
      letter-spacing: -1px;
      color: #34495E;
  }
  
  .rwd-table {
      background: #34495E;
      color: #fff;
      border-radius: .4em;
      overflow: hidden;
  }
  .rwd-table tr {
      border-color: #46637f;
  }
  .rwd-table th, .rwd-table td {
      margin: .5em 1em;
  }
  @media (min-width: 480px) {
      .rwd-table th, .rwd-table td {
          padding: 1em !important;
      }
  }
  .rwd-table th, .rwd-table td:before {
      color: #dd5;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="main_content"&gt;
          &lt;div class="header"&gt;Welcome!! Have a nice day.&lt;/div&gt;
          &lt;div class="info"&gt;
              &lt;table class="rwd-table"&gt;
                      &lt;tr class="table_header"&gt;
                          &lt;th&gt;Movie Title&lt;/th&gt;
                          &lt;th&gt;Genre&lt;/th&gt;
                          &lt;th&gt;Year&lt;/th&gt;
                          &lt;th&gt;Gross&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;Star Wars&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Adventure, Sci-fi&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1977&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$460,935,665&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;Howard The Duck&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;"Comedy"&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1986&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$16,295,774&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td data-th="Movie Title"&gt;American Graffiti&lt;/td&gt;
                      &lt;td data-th="Genre"&gt;Comedy, Drama&lt;/td&gt;
                      &lt;td data-th="Year"&gt;1973&lt;/td&gt;
                      &lt;td data-th="Gross"&gt;$115,000,000&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>