Today a friend on MSN suddenly asked me about this topic. It suddenly occurred to me that in the forum, many people have posted questions about the use of DIV and TABLE tables. Here I want to sort out my thoughts!
About
using WEB
for tablesAfter the standard, 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 the sentence "Why using tables for layout is unwise" is often mentioned in many articles about CSS layout. It may be that everyone has a wrong understanding of it. Here, please note that "using tables for typesetting" is "unwise". It means that we have been using it for many years. It is unwise to use tables for typesetting. In the final analysis, tables are a A way to display "data". 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.
So the so-called feast of tables 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 can really use it. The advantages of tables are revealed.
Therefore, the sentence that has been used for a long time should be changed to "It is unreasonable to use tables as web page layout and layout page elements. Tables are used to display data."
Regarding other elements,
I will follow my usage here
.Based on experience, some elements in the XHTML standard are divided 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 page performance rich and colorful.
The second category I call structured Elements or information elements here refer to TABLE, UL, PRE, and CODE elements, which 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 you need to use a table or list, it is wise to display it in these two ways.
The third category refers to A meta, which is purely for realizing some functions, such as filling in the META keyword with keywords, and making links. A.
Then the correct standard-compliant design idea is:
Use layout elements such as DIV to create the design layout, positioning, color blocks, pictures, etc. of the page. 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. Use the ID attribute of DIV to It is very convenient to use a DIV as a data block that you name.
Therefore, using WEB standards to create a website is actually a process of rationalizing and integrating information. You can still use what elements should be used where. Don’t use tables as layout tools. Just fine.