2011-03-07 7 views
0

최대 높이가 주어진 경우 하위/중첩 테이블을 스크롤 할 수있는 테이블을 만들려면 어떻게해야합니까? 나는 thead가 그것으로 스크롤하는 것을 원하지 않는다.HTML 중첩 테이블 스크롤

<table> 
    <thead> 
     <tr> 
      <th>Column1</th> 
      <th>Column2</th> 
     </tr> 
    </thead> 
    <!-- Insert valid tag here to wrap <tbody>s --> 
    <tbody> 
     <tr> 
      <td>Val1</td> 
      <td>Val2</td> 
     </tr> 
     <tr class="sub-table"> 
      <td colspan="2"> 
       <table> 
        <thead> 
         <tr> 
          <th>Sub Column1</th> 
          <th>Sub Column2</th> 
         </tr> 
        </thead> 
        <tbody> 
         <tr> 
          <td>Sub Val1</td> 
          <td>Sub Val2</td> 
         </tr> 
        </tbody> 
       </table> 
      </td> 
     </tr> 
    </tbody> 
    <tbody> 
     <tr> 
      <td>Val1</td> 
      <td>Val2</td> 
     </tr> 
     <tr class="sub-table"> 
      <td colspan="2"> 
       <table> 
        <thead> 
         <tr> 
          <th>Sub Column1</th> 
          <th>Sub Column2</th> 
         </tr> 
        </thead> 
        <tbody> 
         <tr> 
          <td>Sub Val1</td> 
          <td>Sub Val2</td> 
         </tr> 
        </tbody> 
       </table> 
      </td> 
     </tr> 
    </tbody> 
    <!-- Insert valid close tag here --> 
</table> 
+0

중첩 테이블의 TBODY를 스크롤하려면 중첩 테이블의 THEAD를 고정 시키거나 주 테이블의 THEAD 만 고정해야합니까? – FarligOpptreden

답변

0

것은 내가 제대로 질문을 이해한다면, 아마도 뭔가를 시도 : 내가 정말 찾고 있어요 것은 내가 내의를 포장 할 수있는 몇 가지 유효한 태그, 또는이만큼이나 잘 작동합니다 다른 마크 업입니다 http://jsfiddle.net/pPuXL/1/

게시 한 CSS 예제에서와 같이 오버플로가 작동하려면 TBODY 요소를 "블록"또는 "인라인 블록"으로 표시해야합니다.