iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 20
0
Modern Web

挑戰 CSS 30 天系列 第 20

day20_table

表格:table
標題:th
格子:td

範例如下:

<!DOCTYPE html>
<html>
<head>
  <title>CSS table</title>
  <meta charset="utf-8">
  <style type="text/css">
	table { 
	  font-family: arial;
	  width:200px; 	  
	} 
	th { 
	  background-color:yellow; 
	} 
	.fail { 
	  color:#FF0000; 
	}
  </style>
</head>
<body>
    <table> 
	  <tr> 
		<th>星期</th> 
		<th>天氣</th> 
	  </tr> 
	  <tr> 
		<td>星期一</td> 
		<td>晴</td> 
	  </tr> 
	  <tr> 
		<td>星期二</td> 
		<td>陰</td> 
	  </tr> 
	  <tr> 
		<td>星期三</td> 
		<td class="fail">雨</td> 
	  </tr> 
	</table>
</body>
</html>

結果如下圖:
https://ithelp.ithome.com.tw/upload/images/20171223/20106496lmooFp51y4.png


上一篇
day19_z-index&position&top&left
下一篇
day21_繼承
系列文
挑戰 CSS 30 天30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言