FF下 用 col 隱藏表格列的方法詳解!
更新時間:2008年04月03日 18:54:45 作者:
一直一來,我都在想辦法看能不能用 col 控制表格的列隱藏,但是無奈,F(xiàn)F對COL支持不夠好(其實(shí)是以前沒有發(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下是沒有實(shí)現(xiàn)的,IE沒實(shí)現(xiàn)不竺于FF沒有實(shí)現(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下是沒有實(shí)現(xiàn)的,IE沒實(shí)現(xiàn)不竺于FF沒有實(shí)現(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)文章
解決ie動態(tài)修改link樣式,import css不刷新的問題
當(dāng)我們需要動態(tài)更新link的樣式的時候,通常是直接修改link的 href 屬性。但是如果樣式里有import的樣式表,IE就不會在發(fā)起請求去刷新了(其他瀏覽器都是正常的)2008-05-05不用js多瀏覽器兼容純DIV/CSS對聯(lián)漂浮廣告代碼
兩側(cè)漂浮。經(jīng)測試,兼容IE6,IE7,F(xiàn)irefox瀏覽器2007-12-12CSSvista可同時在IE和Fifrefox調(diào)試的CSS編輯提供下載
CSSvista:可同時在IE和Fifrefox調(diào)試的CSS編輯器 CSSvista是一個免費(fèi)的Windows增強(qiáng)應(yīng)用程序,為Web開發(fā)人員準(zhǔn)備的一個CSS編輯器。它可以讓你同時在IE和Firefox下調(diào)試你的CSS樣式表代碼。2008-06-06