扁平化表格(Flat Table)是一种设计风格,它去除了传统表格中的多层嵌套和复杂的视觉效果,使得表格内容更加简洁、直观。以下是一个扁平化表格的CSS样式模板:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flat Table</title>
<style>
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
th, td {
padding: 12px 15px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:hover {
background-color: #f5f5f5;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>28</td>
<td>john@example.com</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>32</td>
<td>jane@example.com</td>
</tr>
<!-- Add more rows as needed -->
</tbody>
</table>
</body>
</html>
通过以上模板和解释,你可以创建一个简洁、直观的扁平化表格,并根据具体需求进行调整和优化。
领取专属 10元无门槛券
手把手带您无忧上云