iT邦幫忙

2021 iThome 鐵人賽

DAY 6
0

An ordinary CSS table looks like

https://ithelp.ithome.com.tw/upload/images/20210906/201303624OrOKKKqfX.png


Ways of making CSS table beautiful

1. Change the two-line border into a single solid line by border-collapse:collapse

table{
	width:500px;
	border-collapse:collapse;
}

https://ithelp.ithome.com.tw/upload/images/20210906/20130362J660aWCK8j.png

2. Color the first pair of tr child by tr:nth-child(1)

tr:nth-child(1){
	background-color:#5B92E6;color:#ffffff;
}

https://ithelp.ithome.com.tw/upload/images/20210906/20130362i1iTOaYApz.png

3. Color the even tr by tr:nth-child(even)

tr:nth-child(even){
	background-color:#e8e8e8;
}

https://ithelp.ithome.com.tw/upload/images/20210906/20130362xZMTApqye3.png


Final Design

https://ithelp.ithome.com.tw/upload/images/20210906/20130362ZN7mlrjeRp.png


Music of Today: Till Forever Falls Apart by Ashe & FINNEAS

Yes


Like/Share/Follow

If you guys find this article helpful, please kindly do the writer a favor — LIKE this article./images/emoticon/emoticon12.gif
Feel free to comment and share your ideas below to learn together!


上一篇
#5 Types of CSS Selector
下一篇
#7 Web Layout: CSS Fundamentals
系列文
Learn & Play JavaScript -- Entry-Level Front-End Web Development30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言