Domanda

im trying to make rounded border table. but im getting little problem with border, the table border is not rounded..

grid1 { width:100%; border:1px solid #000}

here is the example http://jsfiddle.net/NHNFx/

<table class="grid1"> 
    <tr>
        <th>Salutation</th>
        <td>MR</td>
    </tr>
    <tr>
        <th>First Name</th>
        <td>Greg</td>
    </tr>
    <tr>
        <th>Last Name</th>
        <td>Oden</td>
    </tr> 
</table> 

table { border-collapse:collapse; border-spacing:0; border:0; }


.grid1 { width:100%; border:1px solid #000}
.grid1 tr th { width:115px; padding:20px; background:blue; border-bottom:1px solid #c8c8c8; border-right:1px solid #c8c8c8;}  
.grid1 tr td { padding:20px; background:#f9f9f9; border-bottom:1px solid #c8c8c8; } 

.grid1 tr:first-child th  { border-radius:2em 0 0 0;   }
.grid1 tr:last-child th  {  border-radius:0 0 0 2em ;  }
.grid1 tr:first-child td:last-child  { border-radius:0 2em 0 0; }
.grid1 tr:last-child td:last-child  {  border-radius:0 0 2em 0 ;  }

plz help me...

È stato utile?

Soluzione

You need to remove border-collapse property which prevents the borders to be rounded, anyways you are using border-spacing: 0; so you don't have to use border-collapse for your table

Demo

Altri suggerimenti

Try This

table {
    border-collapse: separate;
    border-spacing: 0;
}
table, td {
    border: 1px solid #404040;
    border-radius: 7px;
    -moz-border-radius: 7px;
    padding: 7px;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top