html - 怎样把 table Angular 弄圆

标签 html css

<分区>

如何使用 css 使 html 表格 Angular 变圆?

表格如下所示:

<table>
    <tr>
       <th colspan="2">header</th>
    </tr>
     <tr>
        <td>data1</td>
        <td>data2</td>
    </tr>
</table>

CSS:

th {
    background-color: black;
    color: white;
    border: none;
}

table {
    border-collapse: collapse;
    border: 1px solid;
    border-radius: 5px;
}

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

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

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

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

只有右上角和左上角是圆 Angular 的,但它们上面有黑色边框没有圆 Angular 。并且底 Angular 不是圆形的。 我希望所有这些 Angular 都是圆的。

最佳答案

简单。在表格上使用 border-radius

table{
		border:1px solid black;
		border-radius:10px;
	}
<!DOCTYPE html>
<html>
<body>

<h2>Filterable Table</h2>
<br><br>

<table>
  <thead>
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Email</th>
  </tr>
  </thead>
  <tbody id="myTable">
  <tr>
    <td>John</td>
    <td>Doe</td>
    <td>john@example.com</td>
  </tr>
  <tr>
    <td>Mary</td>
    <td>Moe</td>
    <td>mary@mail.com</td>
  </tr>
  <tr>
    <td>July</td>
    <td>Dooley</td>
    <td>july@greatstuff.com</td>
  </tr>
  <tr>
    <td>Anja</td>
    <td>Ravendale</td>
    <td>a_r@test.com</td>
  </tr>
  </tbody>
</table>
  

</body>
</html>

关于html - 怎样把 table Angular 弄圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58557412/

上一篇:html - 在 HTML5 中更改文本颜色

下一篇:css - 如何用白色背景颜色填充 div 但宽度较小且居中?

相关文章:

html - 如何使图像可以在不设置高度的情况下在div中重复显示

html - 是什么让 <button> 元素上的文本垂直居中?

html - 具有倾斜底 Angular 的纯 CSS 功能区

javascript - CSS calc如何根据一定的li的量来使用?

html - 显示的图像作为画廊,但不想

javascript - 任何与 iPhone 上的视频播放器重叠的 HTML 内容都无法正常工作

html - TinyMCE:隐藏文本区域

javascript - 使用 AJAX 通过 POST 请求发送 HTML 表单多个 <select> 框?

javascript - 在 url 字符串中传递参数字符串

css - 悬停时反转动画