发布日期:2023-7-18 更新日期: 2023-7-18文章字数 0阅读时长:0分钟

type
Post
status
Published
date
Jul 18, 2023
slug
summary
让表格无痛支持圆角
tags
category
icon
password

📝让表格支持圆角

代码

html

<table> <thead> <tr> <th>表头1</th> <th>表头2</th> <th>表头3</th> </tr> </thead> <tbody> <tr> <td>内容1</td> <td>内容2</td> <td>内容3</td> </tr> <tr> <td>内容1</td> <td>内容2</td> <td>内容3</td> </tr> <tr> <td>内容1</td> <td>内容2</td> <td>内容3</td> </tr> </tbody> </table>

css

table { border-collapse: separate; border-spacing: 0; font-size: 12px; table-layout: fixed; word-break: break-word; } th, td { padding: 6px 16px; border: 1px solid rgba(0, 0, 0, 4%); } th { border-right-width: 0; &:first-child { border-top-left-radius: 8px; } &:last-child { border-top-right-radius: 8px; border-right-width: 1px; } } td { color: rgba(0, 0, 0, 85%); border-width: 0 0 1px 1px; &:last-child { border-right-width: 1px; } } tbody tr:last-child td:first-child { border-bottom-left-radius: 8px; } tbody tr:last-child td:last-child { border-bottom-right-radius: 8px; }
致谢:
💡
有关表格圆角的问题,欢迎您在底部评论区留言,一起交流~
 
 

阶段性迷茫与反思 阶段性迷茫与反思

发现迷茫根因,解决问题痛点


Modal 组件是如何挂载到 body 元素下的? Modal 组件是如何挂载到 body 元素下的?