html - Inner DIV fixed on Scrollable outer DIV -


enter image description here

red box - container blue box - left fixed table column

image description:

blue box: div contains table, contains columns wanted fixed.

red box: container of whole table.

basically wanted have fixed right columns, porting plugin in jquery.

but im gonna make static 1 first html , css

the problem: seen in image, fixed div seems overlap scrollable container resides, wanted relative scroll port or can scrolled vertically , fixed horizontally

why wouldn't using other plugin?.. data putting complicated when using plugin. tailoring time consuming.. maybe if have time can tailor open source one..

please see source below

view file

<div class="row table-wrapper"> <div class="pinned-column">      <table class="table table-bordered">         <thead>             <tr>                 <th colspan="4">                     <div align="right">                         fixed data header 1                     </div>                 </th>             </tr>             <tr>                 <th colspan="4">                     <div align="right">                         fixed data header 1                     </div>                 </th>             </tr>             <tr>                 <th>                     <div style="width: 110px;">                         fd header 1                     </div>                 </th>                 <th>                     <div style="width: 110px;">                         fd header 2                     </div>                 </th>                 <th>                     <div style="width: 110px;">                         fd header 3                     </div>                 </th>                 <th>                     <div style="width: 110px;">                         fd header 4                     </div>                 </th>             </tr>         </thead>         <tbody>             <?php                  ($x = 0; $x < $global_count_x; $x++)                 {             ?>                     <tr>             <?php                      ($i = 0 ; $i < 4; $i++)                     {             ?>                          <td>                             <div style="width: 70px;">                                 <?= 'data '.($i+1) ?>                             </div>                         </td>             <?php                     }             ?>                     <tr>             <?php                  }             ?>         </tbody>     </table> </div> <table class="table table-bordered">     <thead>         <tr>             <th colspan="4">                 <div align="right">                     fixed data header 1                 </div>             </th>             <?php                  ($i = 0 ; $i < $global_count; $i++)                 {             ?>                      <th>                         <div style="width: 70px;">                             <?= 'h'.($i+1) ?>                         </div>                     </th>             <?php                 }             ?>         </tr>         <tr>             <th colspan="4">                 <div align="right">                     fixed data header 1                 </div>             </th>             <?php                  ($i = 0 ; $i < $global_count; $i++)                 {             ?>                      <th>                         <div style="width: 70px;">                             <?= 'h'.($i+1) ?>                         </div>                     </th>             <?php                 }             ?>         </tr>         <tr>             <th>                 <div style="width: 110px;">                     fd header 1                 </div>             </th>             <th>                 <div style="width: 110px;">                     fd header 2                 </div>             </th>             <th>                 <div style="width: 110px;">                     fd header 3                 </div>             </th>             <th>                 <div style="width: 110px;">                     fd header 4                 </div>             </th>             <?php                  ($i = 0 ; $i < $global_count; $i++)                 {             ?>                      <th>                         <div style="width: 70px;">                             <?= 'd'.($i+1) ?>                         </div>                     </th>             <?php                 }             ?>         </tr>     </thead>     <tbody>         <?php              ($x = 0; $x < $global_count_x; $x++)             {         ?>                 <tr>         <?php                  ($i = 0 ; $i < $global_count + 4; $i++)                 {         ?>                      <td>                         <div style="width: 70px;">                             <?= 'data '.($i+1) ?>                         </div>                     </td>         <?php                 }         ?>                 <tr>         <?php              }         ?>     </tbody> </table> 

css file

/*  * common  */ .table-wrapper{     height: 450px;      overflow-x: auto;     overflow-y: auto; } /*  * right-table(right side)  *   */ .pinned-column{     position: absolute;     padding: 0px;     margin: 0px;      background-color: white; }  /*  * pinned-table (left side)  *   */ 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -