gpt4 book ai didi

css - 带有表格边框的 Chrome css 问题

转载 作者:行者123 更新时间:2023-11-28 05:52:18 27 4
gpt4 key购买 nike

我无法在 Google Chrome 中打开它,它总是显示不需要的边框。有什么建议吗?这是我的 HTML 和 CSS 代码:

body, html {
margin:0;
font:1em "Glegoo", slab-serif;
}
table, td, th {
padding:5px;
text-align:center;
border:1px solid #000;
}
table {
width:60%;
text-align:center;
margin:0px auto 0px auto;
overflow:hidden;
float:center;
empty-cells:hide;
border-collapse:collapse;
}
th {
background-color:#000;
color:white;
text-align:center;
}
td {
width:20%;
}
td:empty {
visibility:hidden;
border:none;
outline:none;
}
.edp-bilhetes{
text-align:center;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>musicUS</title>
<link rel="stylesheet" href="C:\Users\JoãoCarlos\Desktop\musicUS\main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Glegoo">
</head>
<body>
<div class="edp-bilhetes">
<br><br>
<table>
<tr>
<td></td>
<div class "table-hide"><td></td></div>
<th colspan="7">Dia</th>
</tr>
<tr>
<td></td>
<td></td>
<td><b>12 de Julho</b></td>
<td><b>17 de Julho</b></td>
<td><b>20 de Julho</b></td>
<td><b>21 de Julho</b></td>
<td><b>23 de Julho</b></td>
<td><b>26 de Julho</b></td>
<td><b>27 de Julho</b></td>
</tr>
<tr>
<th rowspan="8">Plateia</th>
<td>VIP</td>
<td>50€</td>
<td>45€</td>
<td>65€</td>
<td>38€</td>
<td>30€*</td>
<td>50€</td>
<td>65€</td>
<tr>
<td>A</td>
<td>45€</td>
<td>35€</td>
<td>55€</td>
<td>33€</td>
<td>30€*</td>
<td>45€</td>
<td>55€</td>
</tr>
<tr>
<td>B</td>
<td>35€</td>
<td>30€</td>
<td>45€</td>
<td>28€</td>
<td>30€*</td>
<td>35€</td>
<td>45€</td>
</tr>
<tr>
<td>C</td>
<td>30€</td>
<td>-</td>
<td>35€</td>
<td>-</td>
<td>30€*</td>
<td>30€</td>
<td>35€</td>
</tr>
<tr>
<td>Bancada Poente e Nascente</td>
<td>-</td>
<td>-</td>
<td>30€</td>
<td>-</td>
<td>30€*</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>Bancada Norte</td>
<td>-</td>
<td>-</td>
<td>25€</td>
<td>-</td>
<td>30€*</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>Plateia em Pé</td>
<td>25€</td>
<td>20€</td>
<td>25€</td>
<td>20€</td>
<td>30€*</td>
<td>25€</td>
<td>30€</td>
</tr>
<tr>
<td>Mobilidade Condicionada</td>
<td>B</td>
<td>A</td>
<td>B</td>
<td>A</td>
<td>*</td>
<td>B</td>
<td>B</td>
</tr>
</table>
<p>*Bilhete Único</p>
</div>
</body>
</html>

最佳答案

您需要使用一个额外的行和一个额外的单元格,并从表格和这个额外的单元格中删除边框,这个想法是将 colspan 和 rowpan 分派(dispatch)到 2 个不同的行中,以便将它们分开:

body,
html {
margin: 0;
font: 1em"Glegoo", slab-serif;
}
table,
td,
th {
border: 1px solid #000;
padding: 5px;
text-align: center;
}
table,
table tr:first-of-type td {
border: none;
}
table {
border-collapse: collapse;
width: 60%;
text-align: center;
margin: 10px auto 0px auto;
overflow: hidden;
}
th {
background-color: #000;
color: white;
text-align: center;
}
td {
width: 20%;
}
.edp-bilhetes {
text-align: center;
}
<div class="edp-bilhetes">
<table>
<tr>
<td></td>
<th colspan="8">Dia</th>
</tr>
<tr>
<th rowspan="10">Plateia</th>
</tr>
<tr>
<td>-</td>
<td><b>12 de Julho</b>
</td>
<td><b>17 de Julho</b>
</td>
<td><b>20 de Julho</b>
</td>
<td><b>21 de Julho</b>
</td>
<td><b>23 de Julho</b>
</td>
<td><b>26 de Julho</b>
</td>
<td><b>27 de Julho</b>
</td>
</tr>
<tr>
<td>VIP</td>
<td>50€</td>
<td>45€</td>
<td>65€</td>
<td>38€</td>
<td>30€*</td>
<td>50€</td>
<td>65€</td>
<tr>
<td>A</td>
<td>45€</td>
<td>35€</td>
<td>55€</td>
<td>33€</td>
<td>30€*</td>
<td>45€</td>
<td>55€</td>
</tr>
<tr>
<td>B</td>
<td>35€</td>
<td>30€</td>
<td>45€</td>
<td>28€</td>
<td>30€*</td>
<td>35€</td>
<td>45€</td>
</tr>
<tr>
<td>C</td>
<td>30€</td>
<td>-</td>
<td>35€</td>
<td>-</td>
<td>30€*</td>
<td>30€</td>
<td>35€</td>
</tr>
<tr>
<td>Bancada Poente e Nascente</td>
<td>-</td>
<td>-</td>
<td>30€</td>
<td>-</td>
<td>30€*</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>Bancada Norte</td>
<td>-</td>
<td>-</td>
<td>25€</td>
<td>-</td>
<td>30€*</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>Plateia em Pé</td>
<td>25€</td>
<td>20€</td>
<td>25€</td>
<td>20€</td>
<td>30€*</td>
<td>25€</td>
<td>30€</td>
</tr>
<tr>
<td>Mobilidade Condicionada</td>
<td>B</td>
<td>A</td>
<td>B</td>
<td>A</td>
<td>*</td>
<td>B</td>
<td>B</td>
</tr>
</table>
<p>*Bilhete Único</p>
</div>

如果我理解:)

关于css - 带有表格边框的 Chrome css 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37262241/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com