Advertisement
nzisaacnz

Div Table Thing

May 23rd, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.42 KB | None | 0 0
  1. <style>
  2. .head
  3. {
  4.     position:absolute;
  5.     left:0px;
  6.     right:0px;
  7.     top:0px;
  8.     height:50px;
  9.     border:1px solid;
  10. }
  11. .body
  12. {
  13.     position:absolute;
  14.     left:0px;
  15.     right:0px;
  16.     top:50px;
  17.     bottom:50px;
  18.     border:1px solid;
  19.     overflow-y:scroll;
  20.     overflow-x:hidden;
  21. }
  22. .cell
  23. {
  24.     position:absolute;
  25.     border:1px solid;
  26. }
  27. .foot
  28. {
  29.     position:absolute;
  30.     left:0px;
  31.     right:0px;
  32.     bottom:0px;
  33.     height:50px;
  34.     border:1px solid;
  35. }
  36. #table
  37. {
  38.     position:absolute;
  39.     left:0px;
  40.     top:0px;
  41.     width:300px;
  42.     height:500px;
  43.     border:1px solid;
  44. }
  45. </style>
  46. <div id="table">
  47. <div class="head"></div>
  48. <div class="body">
  49. <div class="cell" style="width:50%;left:0%;">ABC</div>
  50. <div class="cell" style="width:50%;left:50%;">ABC</div>
  51. </div>
  52. <div class="foot"></div>
  53. </div>
  54. <script>
  55. function Table(style,parent,brother)
  56. {
  57.     this.table = document.createElement("div");
  58.     this.head = document.createElement("div");
  59.     this.body = document.createElement("div");
  60.     this.foot = document.createElement("div");
  61.     this.cols = [];
  62.     table.style.position="absolute";
  63.     for(var i in style)
  64.     {
  65.         table.style[i]=style[i];
  66.     }
  67.     head.className = "head";
  68.     body.className = "body";
  69.     foot.className = "foot";
  70.     table.appendChild(head);
  71.     table.appendChild(body);
  72.     table.appendChild(foot);
  73.     if(brother)parent.insertBefore(table,brother);
  74.     else parent.appendChild(table);
  75.     this.AddRows = function(count)
  76.     {
  77.        
  78.     }
  79.     this.AddCols = function(count)
  80.     {
  81.        
  82.     }
  83. }
  84. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement