国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

css固定表頭和行頭樣式的方法

發(fā)布時(shí)間:2021-07-27 11:48 來(lái)源:億速云 閱讀:0 作者:chen 欄目: web開(kāi)發(fā)

本篇內容介紹了“css固定表頭和行頭樣式的方法”的有關(guān)知識,在實(shí)際案例的操作過(guò)程中,不少人都會(huì )遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學(xué)有所成!


代碼如下:


<style type="text/css">
<!--
body,table, td, a {font:9pt;}
/*重點(diǎn):固定行頭樣式*/
.scrollRowThead{position: relative;
left: expression(this.parentElement.parentElement
.parentElement.parentElement.scrollLeft);
z-index:0;}
/*重點(diǎn):固定表頭樣式*/
.scrollColThead {position: relative;
top: expression(this.parentElement.parentElement
.parentElement.scrollTop);
z-index:2;}
/*行列交叉的地方*/
.scrollCR { z-index:3;}
/*div外框*/
.scrollDiv {height:200px;clear: both;
border: 1px solid #EEEEEE;
OVERFLOW: scroll;width: 320px; }
/*行頭居中*/
.scrollColThead td,.scrollColThead th
{ text-align: center ;}
/*行頭列頭背景*/
.scrollRowThead,.scrollColThead td,.scrollColThead th
{background-color:EEEEEE;}
/*表格的線(xiàn)*/
.scrolltable{
border-bottom:1px solid #CCCCCC;
border-right:1px solid #CCCCCC; }
/*單元格的線(xiàn)等*/
.scrolltable td,.scrollTable th{
border-left: 1px solid #CCCCCC;
border-top: 1px solid #CCCCCC;
padding: 5px; }
-->
</style>
<h2>利用CSS代碼讓Table產(chǎn)生固定表頭</h2>
<h4>www.865171.cn</h4>
<div id="scrollDiv" class="scrollDiv" >
<table border="0" cellpadding="3" cellspacing="0" width="400" class="scrollTable">
<tr class="scrollColThead" >
<th class="scrollRowThead scrollCR" >&nbsp;</th>
<th colspan="2">列頭</th>
<th colspan="2">列頭</th>
</tr>
<tr class="scrollColThead" >
<th class="scrollRowThead scrollCR" >h2</th>
<th >h3</th>
<th >h4</th>
<th >h5</th>
<th >h6</th>
</tr>
<tr>
<td class="scrollRowThead" >
<input type="checkbox" name="checkbox" value="checkbox">
a</td>
<td>單元格2</td>
<td>單元格3</td>
<td>單元格4</td>
<td>單元格5</td>
</tr>
<tr>
<td class="scrollRowThead" >
<input type="checkbox" name="checkbox2" value="checkbox">
b</td>
<td>單元格2</td>
<td>單元格3</td>
<td>單元格4</td>
<td>單元格5</td>
</tr>
<tr>
<td nowrap class="scrollRowThead" >
<input type="checkbox" name="checkbox3" value="checkbox">
c</td>
<td nowrap>單元格2</td>
<td nowrap>單元格3</td>
<td nowrap>單元格4</td>
<td nowrap>單元格5</td>
</tr>
<tr>
<td class="scrollRowThead" >
<input type="checkbox" name="checkbox4" value="checkbox">
d</td>
<td>單元格2</td>
<td>單元格3</td>
<td>單元格4</td>
<td>單元格5</td>
</tr>
<tr>
<td class="scrollRowThead" >
<input type="checkbox" name="checkbox5" value="checkbox">
e</td>
<td>單元格2</td>
<td>單元格3</td>
<td>單元格4</td>
<td>單元格5</td>
</tr>
<tr>
<td class="scrollRowThead" >
<input type="checkbox" name="checkbox6" value="checkbox">
f</td>
<td>單元格2</td>
<td>單元格3</td>
<td>單元格4</td>
<td>單元格5</td>
</tr>
<tr>
<td class="scrollRowThead" >
<input type="checkbox" name="checkbox7" value="checkbox">
g</td>
<td>單元格2</td>
<td>單元格3</td>
<td>單元格4</td>
<td>單元格5</td>
</tr>
</table>
</div>

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自互聯(lián)網(wǎng)轉載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權請聯(lián)系站長(cháng)郵箱:ts@56dr.com進(jìn)行舉報,并提供相關(guān)證據,一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容。

css
久本草在线中文字幕亚洲| 欧美熟妇另类久久久久久多毛| 真实国产乱子伦视频| 亚洲综合伊人久久大杳蕉| 日韩AV无码精品一二三区| 国产特级毛片AAAAAA视频|