tables.css•915 B
body {
font-family: Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
}
h1 {
color: #2c3e50;
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
background: white;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
caption {
font-size: 1.2em;
font-weight: bold;
margin-bottom: 10px;
color: #34495e;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #3498db;
color: white;
font-weight: bold;
}
thead th {
background-color: #2980b9;
}
tfoot th, tfoot td {
background-color: #f8f9fa;
font-weight: bold;
}
tbody tr:nth-child(even) {
background-color: #f2f2f2;
}
tbody tr:hover {
background-color: #e9f5ff;
}
@media screen and (max-width: 600px) {
table {
display: block;
overflow-x: auto;
}
}