表格在資料呈現上仍具優勢。只要搭配 CSS,即使不使用圖片,也能做出乾淨的細線表格。
table {
border: 1px solid #000;
border-width: 1px 0 0 1px;
border-collapse: collapse;
}
td, th {
border: 1px solid #000;
border-width: 0 1px 1px 0;
}
th {
text-align: center;
font-weight: 600;
background-color: #f4f4f4;
}
關鍵是表格只畫上與左邊框,儲存格只畫下與右邊框,再用 border-collapse: collapse; 合併邊框,即可得到細線效果。