首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设置表格边框的边框半径?

问如何设置表格边框的边框半径?
EN

Stack Overflow用户
提问于 2015-10-15 13:14:09
回答 1查看 297关注 0票数 0

​

代码语言:javascript
复制
table {
  width:100%;
}

table, td, tr {
  border: 1px #000000 solid;
  border-collapse: collapse;
  border-radius: 10px;
}

tr {
  height:50px;
}

.price {
  width: 65%;
  text-align: center;
  background-color: #000000;
  color: #ffffff;
  font-size: 1.5em;
  border-color: #c0c0c0;
  border-radius: 10px;
}

.buy {
  width:35%;
  text-align: center;
  background-color: red;
  color: #ffffff;
  border-color: #c0c0c0;

}
代码语言:javascript
复制
<table>
          <tr>
            <td class="price">$180</td>
            <td class="buy">Buy</td>
          </tr>
          <tr>
            <td class="price">$180</td>
            <td class="buy">Buy</td>
          </tr>
          <tr>
            <td class="price">$180</td>
            <td class="buy">Buy</td>
          </tr>
        </table>

​

我尝试将边界半径设置为我的"td“,但不起作用。

我想要的是,td的左右边界都是半径。

有什么办法可以做到这一点吗?

EN

回答 1

Stack Overflow用户

发布于 2015-10-15 13:35:20

这是给你的jsfiddle:

代码语言:javascript
复制
table {
    width:100%;
    background: #000;
    border: #000 1px solid;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
}
td, tr {
    border: 1px #000000 solid;
    border-collapse: collapse;
    border-radius: 10px;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33140347

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档