Home > Web Front-end > HTML Tutorial > How can we include attributes for table columns in HTML?

How can we include attributes for table columns in HTML?

WBOY
Release: 2023-08-27 13:21:19
forward
1417 people have browsed it

How can we include attributes for table columns in HTML?

Use

to mark properties that contain table columns. The HTML tag allows authors to group together attribute specifications for table columns. It doesn't structurally group columns together - that's what the element does.

The following are the properties-

## tr>

AlignmentHtml5 not support. Character is not supported in Html5. ChaoffNot supported in Html5Span The number of columns that should be spanned,

ValignMiddle

Top

Baseline

Define vertical alignment, Html5 does not support

Width is not supported in Html5. Example
Properties

Value

Description

## Right

Left

Center

Alignment

Characters

Define horizontal alignment,

Character

is defined for Character to align text (used with align = "char"),

p>

pixel

Specify Alignment offset (in pixels or percentage value) relative to the specified first character with char attribute,

p>

number

Definition

does not support Html5.

Bottom

.

pixels or %

Specifies the default width currently Each column spanned by the col element,

You can try running the following code to achieve

tag-

<!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 can we include attributes for table columns in HTML?. For more information, please follow other related articles on the PHP Chinese website!

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