0

I am setting the background color of table rows to give them a visual presence. I've been stymied in doing something I thought would be pretty simple which is rounding the corners of a row. I've created a class that works on a whole table but can't get it to work on the row. (Can't put it on whole table as table has some stuff in it that should not be rounded.) Have tried putting the class in the table row, the table cell inside it and span all to no avail. Would appreciate any suggestions.

css

<head>
    <style>
        .rounded { 
            -moz-border-radius: 15px; 
            border-radius: 15px; 
        }
    </style>
</head>

html

<table>
    <tr><td colspan=3 >Some stuff at top of table where background is white</td></tr>
    <tr style="background-color:silver" class="rounded">
        <td colspan=3 class="rounded"><span class="rounded">Text where background is shaded where I want background shaded</span></td>
    </tr>
</table>
4

1 回答 1

3

这个问题的答案可能会帮助你(看起来不可能在表格行上实现圆角......至少不是在所有浏览器中。):

显示上的 CSS3 边框半径:table-row 元素

注意:这个问题是关于将 div 显示为行,但它等同于使用行。

于 2013-04-14T09:36:56.883 回答