細線表格的幾種做法(css)

(一)效果一般

<style type="text/css">
<!--
table {border-collapse:collapse;}
td{
border-left:0;
border-top:0;
border-right:1px solid #00cd11;
border-bottom:1px solid #cb1122;
font-family:"Courier New", Courier, mono;
font-size:11px;
height:25px;
padding:0 12px 0 12px;
border-collapse:collapse;
}
.tdblue{
font-weight:bold;
color:#3C00C6;
}
-->
</style>

---------------------------------------
<table cellspacing="0" cellpadding="0">
<tr>
    <td class="tdblue">Select My Menu</td>
</tr>
<tr>
    <td>Who am I?</td>
</tr>
<tr>
    <td>細線表格</td>
</tr>
<tr>
    <td>Contact me</td>
</tr>
</table>
---------------------------------------

(二)推薦√√

<style>
table{
border-collapse:collapse;
border: 1px solid #000000;
}
td{
border-collapse:collapse;
border: 1px solid #000000;
}
</style>

<table>
<tr><td>123</td><td>132ssss</td></tr>
<tr><td>123</td><td>132sss</td></tr>
<tr><td>123</td><td>132</td></tr>
</table>
---------------------------------------

(三)推薦√

<style type="text/css">
table{border:1px solid #000;border-width:1px 0 0 1px;margin:2px 0 2px 0;text-align:center;border-collapse:collapse;}
td,th{border:1px solid #000;border-width:0 1px 1px 0;margin:2px 0 2px 0;text-align:left;}
th{text-align:center;font-weight:600;font-size:12px;background-color:#F4F4F4;}
</style>
<table width="236">
<tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
</tr>
</table>
---------------------------------------

(四)效果較好

.thin{background:#000000}
.thin td{background:#FFFFFF;text-align:center}

<table border="0" cellspacing="1" cellpadding="0" class="thin">
---------------------------------------

附錄:

用css設計細線表格並給表頭再加個框

   (用CSS爲<legnd>定義一個邊框)
不錯[還可參考教程中的另一些做法,下次補充]
<table width="200"" cellspacing="0" cellpadding="0">
<tr>
<td>
<fieldset style="width: 200; color: #B7B7B7; border-style: groove" align="center">
<legend style="color: blue; border: 1 solid #000000"> 表中表效果Ⅰ</legend>
<br>
</fieldset>
</td>

</tr>

</table>


border-collapse:collapse :
table中css控制 css的border-collapse
<table width="100%" cellspacing="0" cellpadding="5" border="1" bordercolor="#0099CC" style="border-collapse: collapse;">


seperate 的邊框如下:

|| ||
|| ||

collapse 的邊框如下:
| | (兩個相鄰單元格的相鄰邊合併了)

說明

該CSS屬性用來設定表格的行和列的邊框是合併成單邊框,還是分別有各自的邊框
separate 缺省值。邊框分開,不合並。
collapse 邊框合併。即如果相鄰,則共用同一個邊框。
雖然在DIV+CSS 時代 table 的權重越來越低,但是有時候,還是局部地方table 還是挺好用的


特別是製表方面,還是table 比較的方便。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章