0

Can you help me with making the table corners round? I've tried the simple border-radius but this just split the border in the corners. Is this caused by my browser (Firefox) or its a bug ? Jsfiddle - http://jsfiddle.net/vuys8eef/

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
S.Yankov
  • 107
  • 2
  • 9

3 Answers3

3

You need to round corners for the first and last columns of your first and last row in your table.

Something like this:

table tr:first-child th:first-child {
    border-top-left-radius: 10px;
}


table tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

table tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

table tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

You can see your updated fiddle

service-paradis
  • 3,333
  • 4
  • 34
  • 43
1

You were applying it to the wrong element, use this instead.

td, th{
   border-radius: 5px;
}

CODEPEN DEMO

Peter Girnus
  • 2,673
  • 1
  • 19
  • 24
1

Hello your code is fine but you could to use overflow:hidden on table to hide content inside. That's one way to do this :)

example JSFIDDLE

Szymon
  • 1,281
  • 1
  • 20
  • 36