HTML table properties can define the layout, content, cells and style of the table: 1. Layout properties (border thickness, intra-cell spacing, cell spacing); 2. Content properties (horizontal alignment of table text, Vertically align table text, table summary); 3. Cell properties (width, height, number of rows and columns of merged cells); 4. Style properties (inline styles, CSS classes); 5. Other properties (purpose, short description, unique identifier).
Attributes of tables in HTML
The HTML table element uses attributes to define various aspects of the table. These properties include:
Layout properties:
-
border: Set the thickness of the table border (px)
- cellpadding: Set the spacing between table cells (px)
-
cellspacing: Set the spacing between table cells (px)
Content attributes:
-
align: Horizontally align the text in the table
-
valign: Vertically align the text in the table
-
caption: Define table summary
Cell attributes:
-
width: Set cell width (px or %)
-
height: Set cell height (px)
-
rowspan: Merge cells Number of rows
-
colspan: Number of columns of merged cells
##Style attributes:
- style: Format a table using inline styles
- class: Specify the CSS class to use for an external CSS style sheet
Other attributes:
- summary: Define the purpose of the table
- title: Provide a brief description of the table
- id: Assign a unique identifier to the table
Related properties:
- thead : Define the table header
- tbody: Define the table body
- tfoot: Define the bottom of the table
The above is the detailed content of attributes of table in html. For more information, please follow other related articles on the PHP Chinese website!
Statement: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