FF下 用 col 隱藏表格列的方法詳解!
更新時間:2008年04月03日 18:54:45 作者:
一直一來,我都在想辦法看能不能用 col 控制表格的列隱藏,但是無奈,F(xiàn)F對COL支持不夠好(其實是以前沒有發(fā)現(xiàn)COL在FF下要怎么弄)。
今天,我在一個有52個字段的報表時,迫使我深入的做了一下研究,
我發(fā)現(xiàn):
col在ff下的display 的默認(rèn)值是:table-column
visibility的默認(rèn)值為:visible
我又查查了CSS手冊,發(fā)現(xiàn) visibility 有一個 collapse的可選值,據(jù)說在IE下是沒有實現(xiàn)的,IE沒實現(xiàn)不竺于FF沒有實現(xiàn),就像FF不支持的不一定IE不支持一樣。
BT的我,一個一個試了一遍,
終于發(fā)現(xiàn)了!
FF下可以用下面的方法,用COL把表格的列給隱藏!
歡呼!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標(biāo)題文檔</title>
</head>
<body>
<table width="100%" border="0">
<colgroup>
<col style="visibility: collapse;overflow:hidden;width:0px;" />
<col style="visibility: collapse;overflow:hidden;width:0px;" />
<col style="display:none"/>
<col style="display:none"/>
</colgroup>
<tr>
<td scope="col">IE下,你可以看到這列<td scope="col">IE下,你可以看到這列
<td scope="col">FF下,你可以看到這列<td scope="col">FF下,你可以看到這列</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
我發(fā)現(xiàn):
col在ff下的display 的默認(rèn)值是:table-column
visibility的默認(rèn)值為:visible
我又查查了CSS手冊,發(fā)現(xiàn) visibility 有一個 collapse的可選值,據(jù)說在IE下是沒有實現(xiàn)的,IE沒實現(xiàn)不竺于FF沒有實現(xiàn),就像FF不支持的不一定IE不支持一樣。
BT的我,一個一個試了一遍,
終于發(fā)現(xiàn)了!
FF下可以用下面的方法,用COL把表格的列給隱藏!
歡呼!
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標(biāo)題文檔</title>
</head>
<body>
<table width="100%" border="0">
<colgroup>
<col style="visibility: collapse;overflow:hidden;width:0px;" />
<col style="visibility: collapse;overflow:hidden;width:0px;" />
<col style="display:none"/>
<col style="display:none"/>
</colgroup>
<tr>
<td scope="col">IE下,你可以看到這列<td scope="col">IE下,你可以看到這列
<td scope="col">FF下,你可以看到這列<td scope="col">FF下,你可以看到這列</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td scope="row"> </th>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
相關(guān)文章
div結(jié)合css布局bbs首頁(div+css布局入門)
最近趁離職,我在做一個論壇系統(tǒng),練練手,需要一個論壇首頁的html頁面,深知自己美工極差,心里很苦啊。于是買了本div+css網(wǎng)站布局的書,沒想到講得還不錯,感覺長進(jìn)很快,于是磨拳擦掌非要自己寫一個不可,高手末笑。代碼伺候。2008-11-11
CSS設(shè)置網(wǎng)頁的字體 防瀏覽器瀏覽頁面字體變形
CSS設(shè)置網(wǎng)頁的字體 防瀏覽器瀏覽頁面字體變形...2007-03-03
解決鼠標(biāo)在 flash 鏈接上不停閃動的問題(web頁面中)
解決鼠標(biāo)在 flash 鏈接上不停閃動的問題(web頁面中)...2006-12-12

