Today, a friend on MSN suddenly asked me about this topic. It suddenly occurred to me that in the forum, many people had posted questions about the use of DIV and TABLE tables. I would like to sort out my thoughts here!
About the form
After using WEB standards, it does not mean that the use of tables is excluded. Tables are not useless, but on the contrary, they are a feast. The reason why many articles about CSS layout often mention the sentence why it is unwise to use tables for layout. It may be that everyone has a wrong understanding of it. Please note that it is unwise to use tables for layout. It refers to what we have been using for many years. It is unwise to use tables for layout. In the final analysis, tables are a way to display data. Method, you can imagine that EXCEL is used for this purpose. Sometimes information is displayed in tables so that we can clearly read it, so we use tables, such as company employee contact forms, product and model correspondence tables, etc.
As for the so-called feast of tables, the opinion actually rises to another level. That is to say, if you can flexibly use tables to display customer data, survey data and other information like a professional market analysis company, then you have truly made use of tables. Advantages.
Therefore, regarding the long-used sentence, tables should be used for web page layout instead. Laying out page elements is unreasonable. Tables are used to display data.
About other elements
Based on my experience, I divide some elements in the XHTML standard into three major categories:
The first category is what I call auxiliary layout design elements: here I refer to DIV, SPAN, etc. The main function of these elements is to layout the entire page. Flexible use of various attributes of these elements can make your The page performance is rich and colorful.
The second type I call structured elements or information elements. Here I refer to TABLE, UL, PRE, and CODE elements. They are a way of displaying and organizing information. For example, TABLE is obviously used to display table information, and UL is used. To display columnar information, when tables or lists are needed, it is wise to display them in these two ways.
The third category refers to Ameta, which is purely for realizing some functions, such as METAkeyword for filling in keywords, and A for linking. Then the correct standard-compliant design idea is: use DIV and other layout elements to create pages The design layout, positioning, color blocks, pictures, etc. use elements such as TABLE, UL, etc. to display the data that needs to be displayed on the page. Of course, DIV also plays a role in organizing data. Using the ID attribute of DIV can easily use a DIV as a data block you named
Therefore, using WEB standards to create a website is actually a process of rationalizing and integrating information. You should still use what elements wherever you want. Just don’t use tables as layout tools.