html好看的表格样式
时间: 2023-08-30 22:12:15 浏览: 59
以下是一些漂亮的 HTML 表格样式:
1. 简单的纯 CSS 表格风格:
```css
table {
border-collapse: collapse;
width: 100%;
color: #333;
font-family: Arial, sans-serif;
font-size: 14px;
text-align: left;
}
th, td {
padding: 10px;
border: 1px solid #ccc;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
```
2. 带有阴影和渐变背景的表格风格:
```css
table {
border-collapse: collapse;
width: 100%;
color: #333;
font-family: Arial, sans-serif;
font-size: 14px;
text-align: left;
background-color: #fff;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
}
th, td {
padding: 10px;
border: 1px solid #ccc;
}
th {
background: linear-gradient(to bottom, #f2f2f2 0%, #d4d4d4 100%);
font-weight: bold;
}
```
3. 带有圆角和斑马纹的表格风格:
```css
table {
border-collapse: collapse;
width: 100%;
color: #333;
font-family: Arial, sans-serif;
font-size: 14px;
text-align: left;
background-color: #fff;
border-radius: 10px;
overflow: hidden;
}
th, td {
padding: 10px;
border: 1px solid #ccc;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
```
这些样式只是一些基本的示例,您可以根据自己的需要进行更改和调整。