HTML 和 CSS : rounded corners on tables

标签 html css border radius

我有点问题。我希望我的 table 的所有 Angular 落都是圆形的,但是黑色的行似乎仍然有一个尖锐的边框。感谢您的帮助!

The Problem:

.table_background {
    display: flex;
    background-color: white;
    margin-left: 3vw;
    margin-right: 3vw;
    margin-bottom: 10vh;
    margin-top: 5vh;
    box-shadow: 0px 0px 10px rgba(114, 114, 113, 0.5);
    border-radius: 15px;
}

table {
    font-family: futura-pt, sans-serif;
    font-weight: 400;
    font-style: normal;
    border-collapse: collapse;
    width: 100%;
    border-radius: 15px;
}

th {
    font-size: 18px;
    text-align: left;
    padding: 20px 20px 20px 20px;
}

table,
td {
    padding: 8px 8px 8px 20px;
}

tr:nth-child(even) {
    background-color: #eff2f5;
}

tr:not(:first-child):hover {
    background-color: rgba(114, 114, 113, 0.2);
}

最佳答案

在表格本身上添加“溢出:隐藏”:

table {
    font-family: futura-pt, sans-serif;
    font-weight: 400;
    font-style: normal;
    border-collapse: collapse;
    width: 100%;
    border-radius: 15px;

    /* add this */
    overflow:hidden
}

关于HTML 和 CSS : rounded corners on tables,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59878337/

相关文章:

javascript - 使用文本框值更改按钮单击时的 CSS

javascript - 仅用节点包围文本

css - 无法让文本内容位于屏蔽 div 之上

jquery - 如何将标签添加到我的表单?

whitespace - 行内 block 元素之间的空白

html - 你能只用表格设计边框吗?

java - 在 Swing 中模拟这个 SWT Shell

Javascript - 当我们点击 div 时添加和删除类

javascript - 如何使用 javascript 更改 <title> 元素?

html - 固定边距和宽度的位置 100% 错误