RWDHTMLCSS.COM

Html & CSS Walkthrough

Previous Home Table of Contents Next

CSS for our Table

The Table from last page with styling



March 2023
Sun. Mon. Tue. Wed. Thu. Fri. Sat.
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31



The CSS we applied to the table

<style>

table {
margin:10px auto;
border-collapse:collapse;
background-color:#ebf6f9;
max-width:90%;
box-sizing:border-box;
}
caption {
font-weight:bold;
font-size:1.5rem;
}
tr:nth-child(even) {
background-color:white;
}
th {
border:solid 1px black;
width:60px;
height:60px;
font-family:times new roman, georgia, garamond;
text-align:center;
font-size:.9rem;
box-sizing:border-box;
}
td {
border:solid 1px black;
width:60px;
height:60px;
font-size:1.3rem;
font-weight:bold;
font-family:times new roman, georgia, garamond;
box-sizing:border-box;
text-align:center;
}
td:hover {
background-color:purple;
color:white;
}
@media screen and (max-width: 380px) {
th {
width:40px;
height:40px;
font-size:.75rem;
}
td {
width:40px;
height:40px;
font-size:.9rem;
}
}

</style>



The CSS Explained

Previous Home Table of Contents Next