CSS collapseでテーブルの枠線を重ねて表示する
環境
Google Chrome 106.0.5249.119
Windows 10 Home 64bit
構文
border-collapse: collapse
border-collapseにcollapseを指定しています。テーブルの枠線が重なります。
使用例
<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse; /* テーブルの枠線(ボーダー)を重ねて表示 */
width: 100px;
}
td {
border: 1px solid #000;
}
</style>
</head>
<body>
<table>
<tr>
<td>1001</td>
<td>tokyo</td>
</tr>
<tr>
<td>2002</td>
<td>oosaka</td>
</tr>
</table>
</body>
</html>
結果
テーブルの枠線を重ねて表示します。