Home > Web Front-end > HTML Tutorial > How to include groups of table columns in HTML?

How to include groups of table columns in HTML?

WBOY
Release: 2023-09-10 19:49:35
forward
1417 people have browsed it

How to include groups of table columns in HTML?

Use the

tag to include table column groups. The HTML tag is used to specify the properties of a set of columns within a table. If you need to apply different attributes to the columns in a colgroup, you can use the HTML col tag inside the colgroup tag.

The following are the properties-

The number of columns that should be spanned, does not support Html5

##spannumberDefine is not supported in Html5.

ValignBottomDefine vertical alignment, Width pixels or %Specifies the default width element for each column spanned by the current column,
Properties

Value

Description

Alignment

Right

Left

Centered

Alignment

char

Define horizontal alignment, Html5 does not support .

Character

Character

defines the string used to align text character (used with align ="char"), Html5 does not support .

Chaoff

pixel

Definition

the number of columns that should be spanned,

Middle

Top

Baseline

Html5 does not support it.

Not supported in Html5.

Example

You can try running the following code to implement the

tag in HTML-

<!DOCTYPE html>
<html>
   <head>
      <title>HTML col Tag</title>
   </head>
   <body>
      <p>This example shows a colgroup that has three columns of different widths:</p>
      <table border = "1">
         <colgroup span = "4">
            <col width = "40"></col>
            <col width = "70"></col>
            <col width = "100"></col>
            <col width = "130"></col>
            <col width = "160"></col>
            </colgroup>
         <tr>
            <td>One</td>
            <td>Two</td>
            <td>Three</td>
            <td>Four</td>
            <td>Five</td>
         </tr>
      </table>
   </body>
</html>
Copy after login

The above is the detailed content of How to include groups of table columns in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template