FF下 用 col 隱藏表格列的方法詳解!
更新時間:2008年04月03日 18:54:45 作者:
一直一來,我都在想辦法看能不能用 col 控制表格的列隱藏,但是無奈,FF對COL支持不夠好(其實是以前沒有發(fā)現COL在FF下要怎么弄)。
今天,我在一個有52個字段的報表時,迫使我深入的做了一下研究,
我發(fā)現:
col在ff下的display 的默認值是:table-column
visibility的默認值為:visible
我又查查了CSS手冊,發(fā)現 visibility 有一個 collapse的可選值,據說在IE下是沒有實現的,IE沒實現不竺于FF沒有實現,就像FF不支持的不一定IE不支持一樣。
BT的我,一個一個試了一遍,
終于發(fā)現了!
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>無標題文檔</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ā)現:
col在ff下的display 的默認值是:table-column
visibility的默認值為:visible
我又查查了CSS手冊,發(fā)現 visibility 有一個 collapse的可選值,據說在IE下是沒有實現的,IE沒實現不竺于FF沒有實現,就像FF不支持的不一定IE不支持一樣。
BT的我,一個一個試了一遍,
終于發(fā)現了!
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>無標題文檔</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>
相關文章
解決鼠標在 flash 鏈接上不停閃動的問題(web頁面中)
解決鼠標在 flash 鏈接上不停閃動的問題(web頁面中)...2006-12-12

