is the HTML tbody tag a block-level element? Basic usage of HTML tbody tags

Source: Internet
Author: User
This article mainly introduces the HTML tbody tag is not block-level elements, as well as the basic use of HTML tbody tags, and then let's look at this article about HTML tbody tags

First we need to know what block-level elements and inline elements are:

    • block-level elements , typically starting from a new row, can hold inline elements and other block elements, common block-level elements such as div/p, and so on. "form" This quick element is more special, he can only accommodate other block elements

    • inline elements: Also known as inline elements, are generally the basic elements of the semantic level, and inline elements can only hold text or other inline elements.

Both the block element and the inline element are concepts in the HTML specification. The basic difference between a block element and an inline element is that the block element generally starts with a new row. When CSS control is added, the block element can become an inline element, and inline elements can become block elements.

Let's start by saying that the tbody tag conforms to the standard of block-level elements, so the HTML tbody tag is a block-level element. Someone might ask, how does this know?

Because here's how to start introducing the TBODY tag:

<tbody> Label table body (body). This tag is used to assemble the main contents of an HTML table.

The TBODY element should be used in conjunction with the THEAD and tfoot elements.

The THEAD element is used to group header content in an HTML table, while the TFOOT element is used to group the contents of a table note (footer) in an HTML table.

Note: If you use THEAD, TFOOT, and tbody elements, you must use all the elements. They appear in the order of THEAD, TFOOT, tbody, so the browser can render a footer before all data is received. You must use these tags inside the table element.

Tip: These elements do not affect the layout of the table by default. However, you can use CSS to make these elements change the appearance of the table.

Detailed description: THEAD, TFOOT, and tbody elements give you the ability to group rows in a table. When you create a table, you might want to have a header row, some rows with data, and a total row at the bottom. This partitioning gives the browser the ability to support table body scrolling independent of table headings and footers. When a long table is printed, the table header and footer can be printed on each page that contains the table data.

With the introduction of block-level elements and inline elements, you can see whether the tbody tag is a block-level element or a inline element.

Now let's talk about the basic use of HTML TBODY tags:

Group display of tables (structured table) (IExplore only)

The TBODY element should be used in conjunction with the THEAD and tfoot elements.

GROUP BY row

<thead> ... </thead>-the head of the table (header)

<tbody> ... </tbody>-the body of the table (body)

<tfoot> ... </tfoot>-footnote to table (Footer)

Here are examples of use of HTML TBODY tags:

<table border> <thead> <tr><th>PHP</th><th> Chinese </th><th> web </th ></tr> </thead> <tbody> <tr><td> very </td><td> real </td><td> </td></tr> <tr><td>p</td><td>h</td><td>p</td></tr> </tbody> </table>

What can this code do in the browser?

The above is the use of the HTML tbody tag (want to learn more about the topic.alibabacloud.com, there are any programming courses you want), the problem can be asked below

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.