Таблица с фиксированным текстом внутри position:absolute block

У меня есть HTML table, обернутый блоком с position:absolute. Я хочу, чтобы первая строка (с th или td или обернутая thead) была зафиксирована вверху, а другая таблица должна быть прокручиваемой без фиксированной высоты.

Я пробовал это, но внутри position:absolute это не сработало:

https://jsfiddle.net/dPixie/byB9d/3/light/

html, body{
  margin:0;
  padding:0;
  height:100%;
}
section {
  position: relative;
  border: 1px solid #000;
  padding-top: 37px;
  background: #500;
}
section.positioned {
  position: absolute;
  top:100px;
  left:100px;
  width:800px;
  box-shadow: 0 0 15px #333;
}
.container {
  overflow-y: auto;
  height: 200px;
}
table {
  border-spacing: 0;
  width:100%;
}
td + td {
  border-left:1px solid #eee;
}
td, th {
  border-bottom:1px solid #eee;
  background: #ddd;
  color: #000;
  padding: 10px 25px;
}
th {
  height: 0;
  line-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  color: transparent;
  border: none;
  white-space: nowrap;
}
th div{
  position: absolute;
  background: transparent;
  color: #fff;
  padding: 9px 25px;
  top: 0;
  margin-left: -25px;
  line-height: normal;
  border-left: 1px solid #800;
}
th:first-child div{
  border: none;
}
<section class="">
  <div class="container">
    <table>
      <thead>
        <tr class="header">
          <th>
            Table attribute name
            <div>Table attribute name</div>
          </th>
          <th>
            Value
            <div>Value</div>
          </th>
          <th>
            Description
            <div>Description</div>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>align</td>
          <td>left, center, right</td>
          <td>Not supported in HTML5. Deprecated in HTML 4.01. Specifies the alignment of a table according to surrounding text</td>
        </tr>
        <tr>
          <td>bgcolor</td>
          <td>rgb(x,x,x), #xxxxxx, colorname</td>
          <td>Not supported in HTML5. Deprecated in HTML 4.01. Specifies the background color for a table</td>
        </tr>
        <tr>
          <td>border</td>
          <td>1,""</td>
          <td>Specifies whether the table cells should have borders or not</td>
        </tr>
        <tr>
          <td>cellpadding</td>
          <td>pixels</td>
          <td>Not supported in HTML5. Specifies the space between the cell wall and the cell content</td>
        </tr>
        <tr>
          <td>cellspacing</td>
          <td>pixels</td>
          <td>Not supported in HTML5. Specifies the space between cells</td>
        </tr>
        <tr>
          <td>frame</td>
          <td>void, above, below, hsides, lhs, rhs, vsides, box, border</td>
          <td>Not supported in HTML5. Specifies which parts of the outside borders that should be visible</td>
        </tr>
        <tr>
          <td>rules</td>
          <td>none, groups, rows, cols, all</td>
          <td>Not supported in HTML5. Specifies which parts of the inside borders that should be visible</td>
        </tr>
        <tr>
          <td>summary</td>
          <td>text</td>
          <td>Not supported in HTML5. Specifies a summary of the content of a table</td>
        </tr>
        <tr>
          <td>width</td>
          <td>pixels, %</td>
          <td>Not supported in HTML5. Specifies the width of a table</td>
        </tr>
      </tbody>
    </table>
  </div>
</section>


person tovarisch_che    schedule 08.07.2015    source источник
comment
Я переместил ваш код JS Fiddle во фрагмент стека, так как вопрос должен включать весь соответствующий код. Это может быть только я, но я не совсем понимаю, в чем ваша проблема, насколько я вижу, заголовок исправлен? Что в вашем примере не работает так, как вам хотелось бы?   -  person Hidden Hobbes    schedule 08.07.2015
comment
В моей версии: .container { overflow-y: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; }   -  person tovarisch_che    schedule 08.07.2015
comment
@HiddenHobbes - я ненавижу, когда люди так делают, это действительно усложняет отладку кода, когда он находится в stackoverflow, вы не можете ничего изменить и увидеть результаты. Вы могли бы, по крайней мере, оставить ссылку на страницу скрипки, чтобы люди могли работать с ней, чтобы создать работающую демонстрацию.   -  person vsync    schedule 17.11.2015
comment
@vsync ссылка все еще там? Без кода в самом вопросе (одного jsfiddle.net недостаточно) вопрос рискует быть закрытым.   -  person Hidden Hobbes    schedule 17.11.2015
comment
@HiddenHobbes - да, ссылка все еще здесь, извините. иногда люди удаляют их (некоторые люди редактируют мои собственные ответы, удаляют и заменяют встроенным кодом)   -  person vsync    schedule 18.11.2015