Domanda

It was my understanding that tables can have webkit border radius styles as other elements do:

HTML

<table class="list-table">
    <thead>
        <tr>
            <th>header</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>tables are misunderstood</td>
        </tr>
    </tbody>
</table>

CSS

.list-table {
    width: 100%;
    padding: 0;
    margin: 0;
    text-align: center;
    vertical-align: middle;
    border: 4px solid red;
    border-collapse: collapse;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
}

... so where am I going wrong? See here for a live demo: http://bootply.com/79469#

È stato utile?

Soluzione

Get rid of the border-collapse: collapse; rule.

jsFiddle example

Altri suggerimenti

Put your table in a div and do your border radius on the div and not the table

http://bootply.com/79471

    div {
    border: 4px solid red;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    }
.list-table {
    border-collapse: separate;
    border-spacing: 0;
    border: 4px solid red;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
}

jsFiddle

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top