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

Research on the value of position attribute in CSS (summary)

The CSS position attribute specifies the element&...

Enable sshd operation in docker

First, install openssh-server in docker. After th...

JavaScript simulation calculator

This article shares the specific code of JavaScri...

Vue simple implementation of turntable lottery

This article shares the specific code of Vue to s...

Implementation of k8s deployment of docker container

Environment: (docker, k8s cluster), continue with...

Detailed explanation of Xshell common problems and related configurations

This article introduces common problems of Xshell...

Docker configuration Alibaba Cloud Container Service operation

Configuring Alibaba Cloud Docker Container Servic...

JavaScript implementation of carousel example

This article shares the specific code for JavaScr...

Tips and precautions for using MySQL index

1. The role of index In general application syste...

Implementation of Nginx hot deployment

Table of contents Semaphore Nginx hot deployment ...

Master the CSS property display:flow-root declaration in one article

byzhangxinxu from https://www.zhangxinxu.com/word...

Some problems that may be caused by inconsistent MySQL encoding

Stored procedures and coding In MySQL stored proc...

Service management of source package installation under Linux

Table of contents 1. Startup management of source...

Docker-compose one-click deployment of gitlab Chinese version method steps

1. Introduction to gitlab Gitlab official address...