tags), and each row is divided into a number of cells (defined by
tags). The letters td refer to table data, the contents of data cells. Data cells can contain text, pictures, lists, paragraphs, forms, horizontal lines, tables, and more.
Here is an example:
Table in html
水平表头
Name
Age
Gender
zdd
30
male
垂直表头
Name
autumn
Age
30
Gender
famale
Try it
Borderless table
If the border attribute is not specified when defining the table, then the table will have no border
##
zdd< ;/td>
30
#
Empty cellIf there is no cell Specify the content, then the cell will be empty and have no borders
What if it is solved? The method is to add spaces to empty cells. Since HTML ignores extra spaces, we cannot add spaces directly, but add nbsp to indicate non-breaking space.
##
zdd
30
tr>
#Table with title
Use the caption attribute, but it seems that there cannot be spaces in the title, otherwise it will wrap when displayed! Isn't that too ridiculous?
##
My table
;zdd
30
20
tr>
Crossing rows or columns
##Use colspan to cross rows
Name
Phone number
Bill Gates
555 77 854
555 77 855
Use rowspan to span columns
Name
Bill Gates
Phone
555 77 854
555 77 855
##HTML table header
The header of the table is defined using the
tag.
Most browsers will display the table header as bold, centered text:
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning