FF下 用 col 隱藏表格列的方法詳解!
更新時(shí)間:2008年04月03日 18:54:45 作者:
一直一來(lái),我都在想辦法看能不能用 col 控制表格的列隱藏,但是無(wú)奈,F(xiàn)F對(duì)COL支持不夠好(其實(shí)是以前沒(méi)有發(fā)現(xiàn)COL在FF下要怎么弄)。
今天,我在一個(gè)有52個(gè)字段的報(bào)表時(shí),迫使我深入的做了一下研究,
我發(fā)現(xiàn):
col在ff下的display 的默認(rèn)值是:table-column
visibility的默認(rèn)值為:visible
我又查查了CSS手冊(cè),發(fā)現(xiàn) visibility 有一個(gè) collapse的可選值,據(jù)說(shuō)在IE下是沒(méi)有實(shí)現(xiàn)的,IE沒(méi)實(shí)現(xiàn)不竺于FF沒(méi)有實(shí)現(xiàn),就像FF不支持的不一定IE不支持一樣。
BT的我,一個(gè)一個(gè)試了一遍,
終于發(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>無(wú)標(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手冊(cè),發(fā)現(xiàn) visibility 有一個(gè) collapse的可選值,據(jù)說(shuō)在IE下是沒(méi)有實(shí)現(xiàn)的,IE沒(méi)實(shí)現(xiàn)不竺于FF沒(méi)有實(shí)現(xiàn),就像FF不支持的不一定IE不支持一樣。
BT的我,一個(gè)一個(gè)試了一遍,
終于發(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>無(wú)標(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)文章
web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題集合5
web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題集合5...2006-12-12解決ie動(dòng)態(tài)修改link樣式,import css不刷新的問(wèn)題
當(dāng)我們需要?jiǎng)討B(tài)更新link的樣式的時(shí)候,通常是直接修改link的 href 屬性。但是如果樣式里有import的樣式表,IE就不會(huì)在發(fā)起請(qǐng)求去刷新了(其他瀏覽器都是正常的)2008-05-05不用js多瀏覽器兼容純DIV/CSS對(duì)聯(lián)漂浮廣告代碼
兩側(cè)漂浮。經(jīng)測(cè)試,兼容IE6,IE7,F(xiàn)irefox瀏覽器2007-12-12CSSvista可同時(shí)在IE和Fifrefox調(diào)試的CSS編輯提供下載
CSSvista:可同時(shí)在IE和Fifrefox調(diào)試的CSS編輯器 CSSvista是一個(gè)免費(fèi)的Windows增強(qiáng)應(yīng)用程序,為Web開(kāi)發(fā)人員準(zhǔn)備的一個(gè)CSS編輯器。它可以讓你同時(shí)在IE和Firefox下調(diào)試你的CSS樣式表代碼。2008-06-06