Detailed explanation of HTML table inline format

Detailed explanation of HTML table inline format

Inline format

<colgroup>...</colgroup>

Attribute Name Attribute Value Description

align left
center
right
valign top
middle
bottom
span number inline number

bgcolor color background color

Individual inline settings

Format: <col> has the same function as <colgroup>

<!--Note that setting the DOCTYPE of the first line to xhtml will cause colgroup to fail-->

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2.   
  3. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  4. < head >   
  5.      < title > Table inline format </ title >   
  6. </ head >   
  7. < body >   
  8.      < table   cellpadding = "5px"   cellspacing = "0px"   border = "1px"   bordercolor = "black" >   
  9. <!--Description: Use two sets of colgroup tags to control the entire third column to display in red
  10. The span = "2" in the first colgroup is equivalent to a placeholder, so the third column (the entire math column) will be displayed in red.
  11. Similarly, if you set span = "3" , the fourth column (the entire English column) will be displayed in red.
  12.              < colgroup   span = "2" > </ colgroup >   
  13.              < colgroup   bgcolor = "red" > </ colgroup >   
  14. -- >   
  15. <!-- < col > has the same functionality as < colgroup >
  16. Set the <col> tag to achieve the same function as <colgroup>
  17. Here, we add align = "right" to set the third column (the entire math column) to be right-aligned.
  18. -- >   
  19.          < col   span = "2"   />   
  20.          < col   bgcolor = "red"   align = "right"   />   
  21.          < caption   align = "left" > Student score sheet </ caption >   
  22.          < tr >   
  23.              < th > Name </ th >   
  24.              < th > Chinese </ th >   
  25.              < th > Mathematics </ th >   
  26.              < th > English </ th >   
  27.          </ tr >   
  28.          < tr >   
  29.              < td > Zhang San </ td >   
  30.              < td > 90 </ td >   
  31.              < td > 89 </ td >   
  32.              < td > 99 </ td >   
  33.          </ tr >   
  34.          < tr >   
  35.              < td > Li Si </ td >   
  36.              < td > 98 </ td >   
  37.              < td > 92 </ td >   
  38.              < td > 96 </ td >   
  39.          </ tr >   
  40.          < tr >   
  41.              < td > Wang Wu </ td >   
  42.              < td > 92 </ td >   
  43.              < td > 97 </ td >   
  44.              < td > 91 </ td >   
  45.          </ tr >   
  46.          < tr >   
  47.              < td > Total score </ td >   
  48.              < td > 200 </ td >   
  49.              < td > 200 </ td >   
  50.              < td > 200 </ td >   
  51.          </ tr >   
  52.      </ table >   
  53. </ body >   
  54. </ html >   

The above is all the content of the detailed explanation of HTML table inline format brought to you by the editor. I hope it will be helpful to you. Please support 123WORDPRESS.COM~

<<:  Complete steps to install MySQL 5.5 on CentOS

>>:  Docker Consul Overview and Cluster Environment Construction Steps (Graphical Explanation)

Recommend

H tags should be used reasonably in web page production

HTML tags have special tags to handle the title of...

Alibaba Cloud Centos7.3 installation mysql5.7.18 rpm installation tutorial

Uninstall MariaDB CentOS7 installs MariaDB instea...

Ubuntu terminal multi-window split screen Terminator

1. Installation The biggest feature of Terminator...

Completely uninstall mysql. Personal test!

Cleanly uninstall MySQL. Personally tested, this ...

Docker compose custom network to achieve fixed container IP address

Due to the default bridge network, the IP address...

Tutorial on Installing Nginx-RTMP Streaming Server on Ubuntu 14

1. RTMP RTMP streaming protocol is a real-time au...

Introduction and use of js observer mode

Table of contents I. Definition 2. Usage scenario...

Detailed tutorial on building nextcloud private cloud storage network disk

Nextcloud is an open source and free private clou...

How to effectively compress images using JS

Table of contents Preface Conversion relationship...

Solve the problem of garbled data in MySQL database migration

Under the instructions of my leader, I took over ...

Vue2 implements provide inject to deliver responsiveness

1. Conventional writing in vue2 // The parent com...

Details of watch monitoring properties in Vue

Table of contents 1.watch monitors changes in gen...