Fixed table header Css&jquery

Source: Internet
Author: User

's really into 対応 ブラウザのバージョン
    • Internet Explorer 9/10/11
    • Firefox 29
    • Google Chrome 34
    • Safari 5
    • Opera 12
Method of fixing the head of the table

<table class= "Table-design tablelock1";
<thead>
<tr>
<th>tableheader1</th ><th>tableheader2</th>
<th>TableHeader3</th><th>TableHeader4</th>
</tr>
</thead>
<tbody>
<tr>
<td>Contents1</td><td> Contents2</td>
<td>contents3</td><td>contents4</td>
</tr>
<tr
<td>contents5</td><td>contents6</td>
<td>contents7</td><td >contents8</td>
</tr>
<tr>
<td>contents9</td><td>contents10 </td>
<td>contents11</td><td>contents12</td>
</tr>
</tbody>
</table>

. table-design{
Border-collapse:collapse;
border:1px solid #666;
Text-align:center;
Vertical-align:middle;
margin-bottom:30px;
}
. table-design th{
Background: #ccc;
border:1px solid #aaa;
padding:25px 5px;
}
. table-design td{
border:1px solid #aaa;
padding:25px 5px;
}

    • Method one CSS Fixed

. Tablelock1 thead{
Display:block;
width:482px; /* 500px-スクロールバー*/
}
. Tablelock1 tbody{
Overflow-x: Hidden;
Overflow-y: auto;
-ms-overflow-x: Hidden;
-ms-overflow-y: auto;
Position:absolute;
Display:block;
height:100px;
width:500px;
}
. tablelock1st
,. Tablelock1 TD
{
width:110px;
}

Content source

http://webnonotes.com/css/table-header/

Fixed table header css&jquery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.