Based on some of my recent practices and after communicating with some readers about the use of HTML tables, I decided to write this article. In general, I noticed that they have a preconceived aversion to the use of tables due to misleading information. In fact many people will say "I see that tables should never be used", but this is absolutely wrong! This suggestion only applies to using HTML tables to define the layout of a web page, but tables are perfect for conveniently arranging rows and columns of data information, and if you must display tabular data on a page, you have to use them! why not? However, in this case, some people ignore the existence of certain HTML tags for tables and don't know how to use them correctly.
HTML has 10 table-related tags. Below is a list with an introduction, but first, the document must be properly defined under HTML 4.01/XHTML 1 or HTML 5:
-
Define table title (4, 5) - ##
Define attributes for table columns (4, 5) -
## Define the table notes (bottom) of the table (4, 5)
#Define the header of the table (4, 5) ## Define the header of the table (4, 5)
- ##
Define the rows of the table (4, 5)
A basic table structure is as follows: It contains a title, header, body and footer. The correct order of HTML elements is:-
-
You can also useand
-
-
-
-
The following is an example of a correct table structure: Some tips about forms<table border="1"> <caption>Table caption here</caption> <colgroup span="1" style="background:#DEDEDE;"/> <colgroup span="2" style="background:#EFEFEF;"/> <!-- Table Header--> <thead> <tr> <th>Head 1</th> <th>Head 2</th> <th>Head 3</th> </tr> </thead> <!-- Table Footer--> <tfoot> <tr> <td>Foot 1</td> <td>Foot 2</td> <td>Foot 3</td> </tr> </tfoot> <!-- Table Body--> <tbody> <tr> <td>A</td> <td>B</td> <td>C</td> </tr> <tr> <td>D</td> <td>E</td> <td>F</td> </tr> </tbody></table>
The result in the browser is as shown below:
element must appearAccording to w3schools' explanation and usage, in a table definition, the
before , so that the browser can render the table annotation before receiving all data. Additionally, if it's not in this order, it will not pass W3C's HTML4 and XHTML validation, no matter which DTD you declare. (learn more).
- align
and
attributes were deprecated, so no table attributes are supported in HTML 5 (in fact, in the XHTML 1.0 Strict DTD The "align" and "bgcolor" attributes are no longer supported in );
bgcolor - Empty-cells:show|hide in css can set whether empty cells display borders. Note that this
- needs to be set in table instead of td/th
. This problem is more likely to be encountered in IE6;
- The border-spacing property in CSS is equivalent to the cellspacing property of table.
tag, but Firefox, Chrome, and Safari only support the span and width attributes of the colgroup element; In order to realize the currently advocated development model of separation of performance and structure, front-end observation recommends that all things related to the presentation layer in the page be controlled by CSS, instead of using HTML's own attributes to control the performance of the page, and the table is One of the most easily overlooked.
For more details about tables, please view the W3C document: w3 Introduction to tables
Define a cell (4, 5) |
The above is the detailed content of Rediscovering HTML tables. For more information, please follow other related articles on the PHP Chinese website!

本篇文章带大家了解一下HTML(超文本标记语言),介绍一下HTML的本质,HTML文档的结构、HTML文档的基本标签和图像标签、列表、表格标签、媒体元素、表单,希望对大家有所帮助!

不算。html是一种用来告知浏览器如何组织页面的标记语言,而CSS是一种用来表现HTML或XML等文件样式的样式设计语言;html和css不具备很强的逻辑性和流程控制功能,缺乏灵活性,且html和css不能按照人类的设计对一件工作进行重复的循环,直至得到让人类满意的答案。

总结了一些web前端面试(笔试)题分享给大家,本篇文章就先给大家分享HTML部分的笔试题(附答案),大家可以自己做做,看看能答对几个!

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

在html中,document是文档对象的意思,代表浏览器窗口的文档;document对象是window对象的子对象,所以可通过“window.document”属性对其进行访问,每个载入浏览器的HTML文档都会成为Document对象。

html5废弃了dir列表标签。dir标签被用来定义目录列表,一般和li标签配合使用,在dir标签对中通过li标签来设置列表项,语法“<dir><li>列表项值</li>...</dir>”。HTML5已经不支持dir,可使用ul标签取代。

3种取消方法:1、给td元素添加“border:none”无边框样式即可,语法“td{border:none}”。2、给td元素添加“border:0”样式,语法“td{border:0;}”,将td边框的宽度设置为0即可。3、给td元素添加“border:transparent”样式,语法“td{border:transparent;}”,将td边框的颜色设置为透明即可。


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
