When to use a table after using div

Source: Internet
Author: User
Tags contact form
Author: Allan 2004-11-9 15:47:29
    • Author: Allan
    • Reproduced from: Allan.blog (This article is reproduced by the author's consent, copyright belongs to the author.) If you need to quote or reprint, please contact the author. )
    • Original publication date: November 9, 2004

Today, a friend on MSN suddenly asked me this topic, suddenly thought in fact in the forum, about the use of div and table tables Many people sent a post asked, here I want to tidy up my ideas!

About tables

After using web standards, it's not about excluding the use of tables, the table is not a chicken, but the opposite is a feast, the reason why in many articles on CSS layout is often mentioned in the article "Why the use of table typesetting is not wise" this sentence, it may be that everyone's understanding of him is wrong, here pay attention to "use table typesetting" is Unwise. "means that we have been using it for years, it is unwise to use tables to format, the form of the bottom is a way to display the" data ", you can imagine Excel, the table is the use of this, and sometimes the information used in the table display so that we can be clear and easy to read, so we use the table, For example, the company staff contact form, product and model corresponding table.

So the so-called table meal, in fact, the idea went up to a level, that is, if you can like professional market analysis companies, flexible use of tables to display customer data and survey data, and so on, that is the real advantage of the table.

Therefore, the use of that sentence for a long time, should be changed to "use a table as a Web page layout, page elements are not reasonable, the table is used to display data."

about other elements

I use my experience here to divide some elements of the XHTML standard into three broad categories:

    • The first category is what I call the auxiliary layout design element:
      Here I mean Div,span and so on, the main function of such elements is used to layout the entire page, flexible use of these elements of various attributes, you can make your page performance colorful.
    • The second Class I call a structured element or an informational element
      Here refers to the Table,ul,pre,code class element is a kind of information display and collation, such as table is obviously used to display tabular information, UL is used to display the information, when the need to use a table or list, in these two ways to display is sensible.
    • The third category refers to this, completely to achieve some functions, such as the keyword of the META keyword, as well as a link to do a.

Then the correct way to meet the standard design is:

    • Use div and other layout elements to make page layout, positioning, color blocks, pictures, etc.
    • Use elements such as Table,ul to display data in a page

Of course, Div also plays the role of data collation, using the id attribute of Div can be very convenient to a div as a block of data you name.

Therefore, the use of web standards to create a Web site, is actually a process of rationalization of information, where to use what elements or replicable is not mistaken, do not use the table as a layout tool on the line.







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.