javascript - Adding a fixed header to a dynamic table -


i find myself in need of assistance again, stack overflow.

essentially have table uses angularjs populate various rows data. length of said data changes , such size of table headers changing fit.

my issue having fixed header stays constant in regards size of table body. it's table similar 1 shown in plnkr.

any ideas appreciated including javascript.

    <thead>         <tr>             <th class="statwidth"><span ng-click="setorderproperty('a')"></span></th>             <th>r<span ng-click="setorderproperty('b')"></span></th>             <th>s<span ng-click="setorderproperty('c')" class="glyphicon glyphicon-chevron-down pull-right"></span></th>             <th>d<span ng-click="setorderproperty('d')" class="glyphicon glyphicon-chevron-down pull-right"></span></th>             <th>o<span ng-click="setorderproperty('e')" class="glyphicon glyphicon-chevron-down pull-right">             </span></th>             <th>st<span ng-click="setorderproperty('f')"></span></th>         </tr>         </thead> 

http://plnkr.co/edit/t0qaeblp9qcpzuuqr6jl?p=preview

after table tag can use col element.

for example, 3 columns:

<table>   <colgroup>     <col style="width:40%">     <col style="width:30%">     <col style="width:30%">   </colgroup>     <tbody>     ...   </tbody> </table> 

i arrange fiddle: https://jsfiddle.net/pgh6o54z/


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -