直列化格式
colgroup ... /colgroup

個別直列設置
格式: col 功能完全和 colgroup 一樣
注意設置第一行的DOCTYPE為xhtml會導致colgroup失效
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns= http://www.w3.org/1999/xhtml head title 表格的直列化格式 /title /head body table cellpadding= 5px cellspacing= 0px border= 1px bordercolor= black !--說明:用兩組colgroup標簽來控制整個第三列顯示為紅色 第一組colgroup中的span= 2 相當于一個占位符,這樣第三列(數學這一整列)就會顯示為紅色 同理,如果設置span= 3 ,則第四列(英語這一整列)會顯示為紅色 colgroup span= 2 /colgroup colgroup bgcolor= red /colgroup !-- col 功能完全和 colgroup 一樣 設置 col 標簽達到和 colgroup 一樣的功能 這里加了一個align= right 單獨設置第三列(數學這一整列)右對齊 col span= 2 / col bgcolor= red align= right / caption align= left 學生成績表 /caption th 姓名 /th th 語文 /th th 數學 /th th 英語 /th /tr td 張三 /td td 90 /td td 89 /td td 99 /td /tr td 李四 /td td 98 /td td 92 /td td 96 /td /tr td 王五 /td td 92 /td td 97 /td td 91 /td /tr td 總分 /td td 200 /td td 200 /td td 200 /td /tr /table /body /html
相信看了這些案例你已經掌握了方法,更多精彩請關注php 其它相關文章!
相關閱讀:
怎樣用h5的sse服務器發送EventSource事件
用H5和C3實現簡單的時鐘效果
在Canvas中如何實現自定義路徑動畫?
以上就是HTML table的直列化格式是什么的詳細內容,html教程
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答