Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use div and table reasonably in web Development

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to make rational use of div and table in web development, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Page layout has been my focus since dealing with webpage, from the early table architecture pages to DIV to DIV+Table, it can be said that our requirements have been changing, but the purpose has not changed. Why do you say so, it is obvious from simple to complex, and then from complex to simple; from simple application to complex application; everything is done around demand. Many developers and designers should consider several points when they are engaged in page layout development: whether the layout is reasonable, whether the structure is compact, whether it has sufficient expansibility, and whether it is readable or not. The rational use of Table and DIV to construct our web is an important issue that we discuss. This should be viewed from several different directions:

one。 Positioning

First of all, strictly speaking, table and div are both available reasonable layout methods, you can not deny the value of table, or div has only advantages and disadvantages. It can be said that the web architecture can use either table or div. Then the key is your positioning of your web needs.

We need to consider how much impact web pages will have on our site. For example, our site aims at massive access, massive data, (of course, cache issues are not discussed here), then the architecture will usually reduce the amount of table usage, especially when a large number of loops, of course, table is also useful. For complex site, it is sometimes difficult for div+css to define exactly what we express, and table is a good choice. This is also a problem to be considered before development, to ensure the required cost while achieving the development goal. Similarly, when using div+css to implement a complex page, it is often not as simple as using a table.

two。 Characteristics

Table and div have their own characteristics. It also means that their value orientations are different, which is very important for developers and designers.

Table can easily build a structured interface, and through the parameter definition of table itself, we can quickly define the page layout to the effect we need. Of course, the cooperation of css can be relatively reduced. The disadvantage is that expansibility and readability are relatively poor, poor expansibility is shown in maintenance and correction, a complex table layout of site, her massive pages with changes in demand, developers will be at a loss, a large number of modification requirements will completely shatter the interface development work of web. Poor readability, this is also relatively speaking, let's look at an example: we use the same effect table and div to display a page.

-table

-table

-div 1 Murray-

-div 1 Murray-

-div 2 Murray-

-div 2 Murray-

...

Table is more "rigorous" in performance and has limitations. It can be very difficult to understand when it comes to complex structures. Often, the content of our website program is so large that it is not easy for developers to get a clear outline of the code from their minds right away.

Div, in the html syntax, we know that div contains and functions, if you use it to achieve layout pages, it is almost entirely supported by css, it can be said that div can not be used alone, especially the targeted web, the visual effect requirements for users are very strict, the use of div should be achieved with professional css parameters. From the previous example, we can see that the div layout is more flexible, simple and complex. The same display effect can produce different collocation ways in the cooperation of css and div. Strong scalability is her advantage, developers and designers only need to make adjustments to the corresponding css to make the layout look new, which is far inferior to table. But in the relatively complex part of the structure, it is often difficult to develop div+css, a simple effect of div and css to write for half a day, this table is much better, with WYSIWYG software such as dw, we can easily make things that take half a day to write with div+css.

three。 Compatible

This is an important issue for every website, browser compatibility. In terms of compatibility between table and div, table has more advantages.

Our commonly used ie,ff browsers are very picky about div css settings, and often the same css will have different results on two browsers, which is a terrible problem for developers. It is impossible for us to repel users' browsers, so only by adjusting our syntax and layout methods during development. Div requires us to have strict css support, while table doesn't have to think about it. Table's rigor has performed well in different browsers.

After considering our positioning, characteristics, compatibility issues, how to layout, what kind of architecture to adopt I think everyone should be very clear, I would like to say that for real developers to make good use of its benefits is the most important idea. Rather than blindly prefer, or reflect their own technical ability to do development and design work. For div, we can give full play to its flexible and clear architecture features, with the rigor of table to achieve a variety of webpage requirements.

Thank you for reading this article carefully. I hope the article "how to make rational use of div and table in web Development" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report