Skip to content

Instantly share code, notes, and snippets.

@Samnan
Forked from solnic/rounded_corners_table.sass
Created June 25, 2011 06:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Samnan/1046247 to your computer and use it in GitHub Desktop.
Save Samnan/1046247 to your computer and use it in GitHub Desktop.
Here's how to do a table with rounded corners in CSS3
@import compass/reset
@import compass/css3/border-radius
table
border: none
border-collapse: separate
th, td
padding: 5px
thead
background-color: #f2f6fa
th
border: 1px solid #ccc
border-left: none
&:first-child
border-left: 1px solid #ccc
+border-radius(5px 0px 0px 0px)
&:last-child
border-right: 1px solid #ccc
+border-radius(0 5px 0px 0px)
tbody
tr
td
border-right: 1px solid #ccc
border-bottom: 1px solid #ccc
&:first-child
border-left: 1px solid #ccc
&:last-child
td
&:first-child
+border-radius(0px 0px 0px 5px)
&:last-child
+border-radius(0px 0px 5px 0px)
<table>
<thead>
<tr>
<th>name</th>
<th>email</th>
</tr>
</thead>
<tbody>
<tr>
<td>john</td>
<td>john@domain.com</td>
</tr>
<tr>
<td>jane</td>
<td>jane@domain.com</td>
</tr>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment