css - 如何在 TH 上放置圆形边框而不出现尖 Angular ?

标签 css

试图让我的 table 看起来漂亮,但我无法摆脱那些尖 Angular ......

enter image description here

这是 HTML

<table border="0" cellspacing="0" cellpadding="0" class="expense-table-pink">
<thead>
    <tr style="background-color: #bb1133;">
        <th>aaa</th>
        <th>bbb</th>
        <th>ccc</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>aaa</td>
        <td>bbb</td>
        <td>ccc</td>
    </tr>
</tbody>
</table>

还有 CSS

.expense-table-pink {
    width:100%; 
    background-color: #f9ecee;
    border: 1px solid #bb1133; 
    border-collapse: separate; 
    border-spacing: 0; 
    border-radius: 6px;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;    
    font-weight: normal;     
}

最佳答案

这是边界像素与 Angular 像素的问题。在这种情况下,将 border 增加到 2px 可以解决此问题:

.expense-table-pink {
    width:100%; 
    background-color: #f9ecee;
    border: 2px solid #bb1133; 
    border-collapse: separate; 
    border-spacing: 0; 
    border-radius: 6px;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;    
    font-weight: normal;
}
<table border="0" cellspacing="0" cellpadding="0" class="expense-table-pink">
<thead>
    <tr style="background-color: #bb1133;">
        <th>aaa</th>
        <th>bbb</th>
        <th>ccc</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>aaa</td>
        <td>bbb</td>
        <td>ccc</td>
    </tr>
</tbody>
</table>

关于css - 如何在 TH 上放置圆形边框而不出现尖 Angular ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45532092/

相关文章:

javascript - 使用 ngb-carousel 在单个 slider 页面中显示多个图像

css - 如何从相对位置删除多余的空间?

javascript - 为同名的多个类抓取浮点值

html - 多行按钮旁边的图标

javascript - 如何动态获取html5中的图表和报告?

jquery - Shopify 商店背景视频未在移动设备上显示

html - 如何在行中 float 元素。

css - 如何垂直居中这个基于 css/javascript 的模式对话框?

css - 改变背景颜色的高度

css - 如何使用 Compass 从多个文件夹生成一个 Sprite ?