2011-03-26 37 views
0

我有這個問題;我目前正在對生成表的Web應用程序進行一些修改。基本上我需要改變表格的呈現方式,例如在它上面添加圓角。C#css表(css重新設計)

我有3個細胞

________________________ 
| cell 1 | cell 2 | cell 3 | 
------------------ 

截至目前,我嘗試做的是使用在小區1和小區3單元一類的標籤添加背景圖片1是不錯,唯一的問題是與單元格3 ...因爲圖像卡在標籤的左側。我試圖用文本對齊將它向右推,但顯然這是錯誤的命令。我想知道如何才能將圖像推到單元格3的右側。

.table{position: relative; bacground:#ffffff; border:0px; border-collapse: collapse;} 
.cell1, .cell3 {position:relative; height:40px; width:50; margin-bottom:-1} 
.cell2 {width: 100px;} 
.cell1{background: url(/imageleft.gif) no-repeat #ffffff;} 
.cell2{background: url(/imageright.gif) no-repeat #ffffff; text-align: right;} 

任何想法感謝!

回答

1

是關於背景圖片,對吧?那麼你應該可以使用背景位置屬性..就像:

.cell3 {background: url(/imageleft.gif) no-repeat #ffffff top right;} 
+0

真棒,它的工作!謝謝! – gdubs 2011-03-26 16:11:40

0

最簡單的方法是將表格包裝在一個DIV中,然後給該DIV指定圓角。

HTML:

<div class="table_wrapper"> 

    <table>...</table> 

</div> 

CSS:(紅色背景顯示效果)

.table_wrapper { background:red; border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; padding:10px; } 
.table_wrapper table { width:100%; } 
+0

好吧,我試圖給EACH ROW一個圓角。所以基本上每個東西都在。 – gdubs 2011-03-26 16:12:47