HTML 和 CSS:表格上的圆角
HTML and CSS: rounded corners on tables
我有点问题。我希望我的 table 的所有角都是圆角的,但是黑色的行似乎仍然有尖锐的边框。感谢您的帮助!
.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
设置 overflow:hidden
。试试这个
table {
font-family: futura-pt, sans-serif;
font-weight: 400;
font-style: normal;
border-collapse: collapse;
width: 100%;
border-radius: 15px;
overflow: hidden;
}
在 table 本身上添加 "overflow:hidden":
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
}
我有点问题。我希望我的 table 的所有角都是圆角的,但是黑色的行似乎仍然有尖锐的边框。感谢您的帮助!
.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
设置 overflow:hidden
。试试这个
table {
font-family: futura-pt, sans-serif;
font-weight: 400;
font-style: normal;
border-collapse: collapse;
width: 100%;
border-radius: 15px;
overflow: hidden;
}
在 table 本身上添加 "overflow:hidden":
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
}