I'm trying to make a full width table that has rounded corners, a border around the entire table, and a border under each table row (except the last one, don't want to double up...).
My sample: http://jsfiddle.net/7xD64/13/
My code:
<table>
<tbody>
<tr>
<td>One</td>
<td>Two</td>
</tr>
<tr>
<td>Three</td>
<td>Four</td>
</tr>
</tbody>
</table>
table {
overflow: hidden;
border-radius: 10px;
background-color: white;
border: 1px solid black;
border-collapse: collapse;
border-spacing: 0;
width: 100%
}
tr {
border-bottom: 1px solid black;
}
This works perfectly in Chrome, but is broken in Safari (there is no outer border). If I remove the overflow: hidden
it renders the outer border, but the table doesn't have rounded edges.
I've found a few solutions, but they don't seem to work on tables (or, as is likely, I'm not implementing them properly).
Question: Is it possible to make a table that has the following and works in Chrome, Safari and IE(8+)?
- border around the entire table
- rounded edges (with border) for the table
- borders at the bottom of each table row
- table is full width
If is is possible, could you please update my fiddle / code to explain how it works? (I'm still getting started with CSS, and I get pretty confused about where to put the rules.)
Thanks!