Gives solution for any Error occurs in any Programming Language, .Net Core 3.1, 3.0, C#,Asp.Net,Sqlserver,MVC,Java,Php,Html,Css,Jquery,errors and solutions,Latest News,Technology

Saturday 20 August 2016

Html table fixed header with scrolling body only in ASP.NET, MVC using Jquery, CSS

No comments :
Here I will explain about how to write a code for html table with fixed header. Here I will take header columns in one table and content placed in another table in a division. I give a class name (.div-table-content) to the body data division.

.div-table-content { //div class name
            height: 350px;
            overflow: auto;
            margin-right: -14px;
        }

<div class="tblSearchUserData">
                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th style="width: 40%">ID</th>
                                <th>First Name</th>
                                <th>Last Name</th>
                                <th>Company</th>                              
                            </tr>
                        </thead>
                    </table>
                    <div class="div-table-content">
                        <table class="table tablesorter table-condensed" id="tblSearchUserData">
                            <tbody>
                              <tr>
                                   <td>1</td>
                                   <td>Ramesh</td>
                                   <td>K</td>
                                   <td>Google</td>
                                   </tr>
                                   <tr>
                                   <td>2</td>
                                   <td>Rasul</td>
                                   <td>Y</td>
                                   <td>Yahoo</td>
                                   </tr>
                            </tbody>
                        </table>
                    </div>                  
                </div>


No comments :

Post a Comment