달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

<!DOCTYPE html> <html> <head>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">     <style>                  .list_box {border-top:solid 1px #C9D8DCborder-left:solid 1px #C9D8DC;width:100%;}         .list_box>thead>tr>th {height:30pxborder-bottom:solid 1px #C9D8DCborder-right:solid 1px #C9D8DCbackground-color:#E1EAF0;font-size:0.6em;}         .list_box>tbody>tr>td {border-bottom:solid 1px #C9D8DCborder-right:solid 1px #C9D8DCtext-align:center;font-size:0.6em;}     </style>     <style type="text/css">         .scrolltable {             overflow-xauto;             /*overflow-y:hidden;*/             height100%;             displayflex;             display-webkit-flex;             flex-directioncolumn;             -webkit-flex-directioncolumn;         }         .scrolltable > .header {         }         .scrolltable > .body          {             /*noinspection CssInvalidPropertyValue*/             /*width: -webkit-fit-content;*/             overflow-yauto;             flex1;             -webkit-flex1;         }         thtd {             min-width4em;         }         /* an outside constraint to react against */         #constrainer {             width100%;         }         /* only styling below here */         #constrainer {         }         table {             border-collapsecollapse;         }         thtd {             /*border: 1px solid gray;*/         }         th {             background-colorlightgrey;             border-width1px;         }         td {             border-width1px;         }         tr:first-child td {             border-top-width0;         }         tr:nth-child(even) {             background-color#eee;         }     </style>     <script src="@Url.Content("~/resource/common/js/jquery-1.11.1.min.js")"></script> </head> <body style="overflow:hidden;">     <div id="constrainer">         <div class="scrolltable">             <table class="header list_box">                 <thead>                     <tr>                         <th>일자</th>                     </tr>                 </thead>             </table>             <div class="body" >                 <table class="list_box">                     <tbody>                         @foreach (var item in Model)                         {                             <tr>                                 <td>@item.StatDate.Substring(5)</td>                             </tr>                         }                     </tbody>                 </table>             </div>         </div>     </div>     <script>         $(function ()         {             var height = $(window).height() - 15;             $("#constrainer").css({ "height": height });         });     </script> </body> </html>

테이블의 헤더 영역은 고정하고, 컨텐츠 영역만 스크롤 처리할때. 

'HTML 이야기' 카테고리의 다른 글

순수 CSS로 테이블 행 및 열 고정 처리.  (0) 2015.12.31
HTML5 Canvas 가지고 놀기 2번째!!  (0) 2012.06.05
HTML5 Web Worker  (0) 2012.06.04
HTML5 Storage  (0) 2012.06.04
HTML5 Canvas 가지고 놀기~!  (0) 2012.05.31
Posted by 은하비류연
|