2010-09-03 113 views
0

我只需要顯示我的普通html表格,其中它只顯示行和隱藏列中的行,以便另一個人看到它,認爲它是一列有一列,但實際上它有多列...我不能使用合併單元格,因爲我需要的列本身...表格顯示格式

請幫助 感謝..

+0

一張表格顯示一列,但有很多列?你的問題很不明確 - 請仔細閱讀,如果有人不瞭解上下文可以理解並重寫,以便其他人能理解它。 – Oded 2010-09-03 07:21:33

回答

0

使用CSS樣式表格:

td { 
    border-bottom: 1px; 
    border-top: 1px; /* optional, you will have to play with the formatting */ 
    border-left: none; 
    border-right: none; 
} 

這將使一個頂部和底部邊框每個數據單元,它應該做你需要什麼。使用格式來播放一點,以確保您的播放正確無誤。

1

關閉邊境關閉您:<table border="0" class="thisTable">,並給它一個像類的例子。然後下面的行添加到您的CSS:

table.thisTable { 
border-bottom:1px #000 solid; 
// edit: 
border-spacing:none; // you need this to take away spacing you still see 
border-collapse:collapse; // you need this to take away spacing you still see 
} 

table.thisTable td { 
border-top:1px #000 solid; 
} 

這將在頂部每個TD添加邊框和表底了與底邊框。

希望這會有所幫助。

//編輯:

添加類各<tr>的第一個和最後<td>和定義你的CSS下面還有:

table.thisTable td.first { 
border-left:1px #000 solid; 
} 

table.thisTable td.last { 
border-right:1px #000 solid; 
} 

這將圓邊框很好地襯托沿桌子的邊緣。

+0

很好的答案。比我自己的解決方案更優雅。 – 2010-09-03 07:23:38

+0

這是接近我所需的解決方案,但我仍然需要更多關於此問題的建議, ,因爲我使用的是背景顏色,它仍然在列線上顯示一些列陰影或標記。我需要刪除這個。 謝謝 – soorajthomas 2010-09-03 08:17:31

+0

Sooraj,我解決了我的答案,以解決列之間的間距。往上看。 – 2010-09-08 13:29:41