給大家分享一個好看的HTML的表格樣式,這個表格每個格子裡都有背景圖,
首先你需要下載倆張圖,
cell-blue.jpg
cell-grey.jpg
命名為cell-blue.jpg和cell-grey.jpg
拷貝下面的代碼到你想要的地方,記得修改圖片url
<!-- CSS goes in the document HEAD or added to your external stylesheet --><style type="text/css">table.imagetable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #999999;border-collapse: collapse;}table.imagetable th {background:#b5cfd2 url('cell-blue.jpg');border-width: 1px;padding: 8px;border-style: solid;border-color: #999999;}table.imagetable td {background:#dcddc0 url('cell-grey.jpg');border-width: 1px;padding: 8px;border-style: solid;border-color: #999999;}</style><!-- Table goes in the document BODY --><table class="imagetable"><tr><th>Info Header 1</th><th>Info Header 2</th><th>Info Header 3</th></tr><tr><td>Text 1A</td><td>Text 1B</td><td>Text 1C</td></tr><tr><td>Text 2A</td><td>Text 2B</td><td>Text 2C</td></tr></table>
需要的朋友可以直接拿去用,更多精彩請關注php中文網其它相關文章!
相關閱讀:
class與id有什麼區別
怎麼讓網頁變黑白色
HTML網頁字型大小的設定