Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the table properties of HTML

Shulou Source: shulou.com Published: 2022-06-01 10:28:43 10月03日 Update

This article is about what the table attribute of HTML has. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

What is a table & the function of a table

What is a table: made up of rectangular boxes called cells arranged together from left to right and top to bottom

The function of a table: to display information in a certain structure.

How to use table tables

Define the table:

Create a table row:

Create a column (cell):

Note: by default, the number of columns in each row is uniform.

Features of the table table:

1. Monopolize one line

2. Width adaptation (determined by content)

Table table properties:

Attribute

Width: setting table width

Height: setting table height

Align: sets the horizontal alignment of the table in its parent element. Value: left,center,right

Border: border, border width, value in px, px can be omitted

Cellpadding: cell inner margin

The distance between the cell border and the content

Cellspacing: extra margin of the cell

The distance between a cell and a cell or between a cell and a table

Bgcolor: background color

Attribute

1.align: horizontal alignment of the content of the line

2.valign: vertical alignment of the contents of the line. Value: top,middle,bottom

The text color of the 3.bgcolor line

Attribute

Width

Height

Align

Valign

Bgcolor

Colspan sets cells across columns

Rowspan sets cells across rows

3. Other tags in the table table

1.

Purpose: define a title for a table

Location: display in the center directly above the table

Title

two。 Row or column headings

Column headings: for each column in the first row, the bold, horizontal center effect is displayed.

Row title: the first column in each row, bold, horizontally centered

Row (column) header:

The effect is exactly the same.

Table border merge:

Attribute: border-collapse

Value:

1.separate default value, detach border mode

2.collapse Border merge Mod

Table border margin:

1. Function: sets the distance between the borders of adjacent cells (similar to cellspacing)

two。 Attribute: border-spacing

Value:

1. Take 1 value: indicates equal horizontal and vertical spacing

two。 Take two values: the horizontal spacing represented by the first value

The vertical spacing represented by the second value

Separate the two values with a space

3. Request

Border-collapse must be separate

Must be valid when detaching border mode

Hidden display effect:

Attribute: visibility:collap:se

Used on table elements, deleting a row or column does not affect the entire layout of the table

Thank you for reading! This is the end of this article on "what are the table attributes of HTML?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Table cell attribute border title content horizontal between action row width effect way mode spacing element more article color good Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft Shulou Technology Shulou Information vpn