This article shares with you a summary of the different table attributes of HTML (with code). The content is very good. Friends in need can refer to it. I hope it can help everyone.
Here we mainly summarize and record some attributes and simple styles of the table for future convenience.
1. Used to define the table of HTML, with local attributes border represents the border, and the value of the border attribute must be 1 or the empty string (""). This attribute does not control the style of the border, but is controlled by CSS The table element can have tr, th, td, thead, tbody, tfoot, colgroup elements 2, Used to define a row of the table. Since HTML tables are row-oriented, each row must be represented separately The tr element can be used within the table, thead, tbody and tfoot elements The tr element can contain one or more td Or th element Its align, bgcolor and other attributes are obsolete. If you want to set attributes, please use CSS settings 3, Used to define table cells, can be used with colspan, rowspan, headers local attributes (1)colspan: column span, this attribute specifies the columns that the cell can span Number, the value of this attribute must be an integer (2) rowspan: row span, this attribute specifies the number of rows that the cell can span, the value of this attribute must be an integer ( 3) headers: The value of this attribute is the ID attribute value of one or more cells, which associates the cells with column headers and can be used with screen readers ⚠️: Each The table must contain the above three elements A simple example The effect is as follows: 4. Used to define the title cell so that we can effectively distinguish the data and its description It The same local attributes as the td> element have the following differences: Used to define the header of the table and the wrapper of the table header. You can define one or more rows, which are column labels of the table element Without thead element, all tr are assumed to belong to the body of the table Used to define the body of the table Used to define the footer of the marked table ⚠️: Used to define table column groups, which can be used to apply styles to a certain column. Of course, you can also use the following The col element has the local attribute span Used to represent a single column of the table, it is recommended to use Used to define the title of the table, each The table can only contain one A simple example: The effect is as follows: Introduction to how to dynamically generate html elements and add attributes to elements (with code)
nbsp;html>
A
B
C
D
E
F
is the header Marker, usually located in the first row or column. Moreover, the text in
will be bolded by default, but
will not.
is a data mark, indicating the specific data of the cell. ## 5.
,
tags must have the
tag inside them
tag, will be assigned to the head and bottom of the table respectively. can appear before or after
or
. Before html5, the
element must appear before the
element. In html5, the
element can be placed after the
or the last element
nbsp;html>
View Code
Rank
Name
Color
Size & Votes
Rank Footer
Name Footer
Color Footer
Size And Votes Footer
Favorite:
XML
CSS
Java
IOS
2nd Favorite:
Web
HTML5
CS
460
Related recommendations:
The above is the detailed content of Summary of different table attributes of HTML (with code). For more information, please follow other related articles on the PHP Chinese website!

Self-closingtagsinHTMLandXMLaretagsthatclosethemselveswithoutneedingaseparateclosingtag,simplifyingmarkupstructureandenhancingcodingefficiency.1)TheyareessentialinXMLforelementswithoutcontent,ensuringwell-formeddocuments.2)InHTML5,usageisflexiblebutr

To build a website with powerful functions and good user experience, HTML alone is not enough. The following technology is also required: JavaScript gives web page dynamic and interactiveness, and real-time changes are achieved by operating DOM. CSS is responsible for the style and layout of the web page to improve aesthetics and user experience. Modern frameworks and libraries such as React, Vue.js and Angular improve development efficiency and code organization structure.

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
