HTML+CSS Tutorial: Tables table elements Web page making tips

Source: Internet
Author: User
Tags end header resource first row




Article Introduction: The table element is used in HTML to render tabular data. You can use it as a way to describe and present data that can be used in spreadsheets.





element is used in HTML to render tabular data. You can use it as a way to describe and present data that can be used in spreadsheets. It's essentially made up of these two things: rows and columns. In this article we'll explore how to use them, when to use them, and all the other things you need to know.




A very basic example



Here is a very simple example of tabular data:






This is a data that spans multiple axes. Imagine getting information about someone through a line that you have to finger across. or from top to down to feel the pattern and change of a data point.



Table headers and table bodies



One of the things we didn't do in the basic example above is not to say semantically that the first row is the head of the table. We should have done that. The entire first row section does not contain data, it is just the title of each column. So we cando the element to finish this thing, it will wrap the first

element (it will wrap all the headers needed for the line)




The HTML code looks like this:






When you use anelement, the

element cannot have a directchild element, and all rows must exist in,andinside. Notice that we're going to include all the data rows in it.




End of table



Togetherwith

the lines that areused to wrap the table footer.as it is, it only semantically points out the auxiliary information and does not contain any other data.




The unique point is its position in the HTML, which followsand is in

front of it! You might think it's thetablelast element before the end of the label, but that's not the case. Because the footer may contain the necessary information to understand the table, it should be in front of the data in the resource sequence.




Although it appears first in the resource sequence,it is actually rendered at the bottom of the table, making it an unusual HTML element.



For example, it can be used in a scenario where a long or high table repeats the header information, making it easier for thereader to see the title of the list at the bottom without going back to the head. But you don't need to use it that way.






It's a good technique to have some element positions that bounce from top to bottom as needed. For example, although a navigation is at the bottom of the screen, navigation in the HTML source should be at the top.



Cell: TD and TH



A separate cell in a table is always

in the first row of elements. We'll give you an example of that later.








or either , you can put anything into a table cell if you want to, but make those elements a cell element in the table. Is "the title of the table" and "table data".




Using our existing simple example, the top row is all header information. They are the title of the data, not the data, and all the remaining rows are data. As follows:







Elements do not have to be placed inelements. They simply point to the head information. So they can also be used

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.