html - <table> vs <div> (yet again) -


I generally agree with the idea that the layout of the web site is & lt; Table & gt; Instead of & lt; Div & gt; Should be done with. However, I have a situation where it does not work - or at least, I have not found any solution.

I have a dynamic site where many customers share the same template (they can choose from one set of available templates) defines the general layout of a template site - usually the top, Two or three columns (menu at the top, primary content in the middle, and sometimes additional material on the right), and the footer at the bottom header - nothing fancy. Customers' header and content on the right side and the control of the menu and key content areas have complete control over important controls.

The point here is that I do not know what the width is, of any column. Customers can have long or short text for each menu item, they can put small or large images in the right-hand column, and the main content can be a free-to-none. I can not apply too much design restrictions on my customers - they have their views on how the site should look (some of them are crooked compared to the MySpace page) a 'favorite' width for the site (main & lt; table & Gt; width of the property), so that the content is appropriate, the site has a good presence.

A table-based layout manages this - whatever size comes out in the shape of the column, the table is adjusted to fit the & lt; Div & gt; Although not If the menu gets a bit higher, then the other columns are given below. If some containers are too broad for its container & lt; Div>, it extends beyond the boundary and then interferes with whatever happens.

I used javascript to adjust the width of the column, but this is the flash layout, where a & lt; Table & gt; Just renders it without any fuss. I know about the various table-related options for the CSS display property, but since they are not widely supported (Naughty IE) I can not use them (and on one hand, as one side, The argument is that there was no intention of using for the & lt; table & gt; layout, so instead we should use & lt; div & gt; and then make them & lt; table & gt; me For.)

this Until I have all the usual reasons & lt; Div & gt; Based layout, I do not believe that I do not want to upgrade these templates (or, at least, not all IE 10) I'm hoping that the SO Gang will find me a way to do this Can help.

You can make an argument that in your case, layout is essentially After all, a table often, & lt; Div & gt; In the point of it determines that the exact layout does not matter much to anything that is is to be adaptable if the screen size changes, so that your original layout is not possible , Then the browser wants to revoke the elements to get that thing which still works. This is the reason that & lt; Div & gt; 's is usually preferred.

In your case, you want to give that control to the user and then it is effectively a table, where they meet to select the dimensions and content of each cell. The fact that it ends in search of a webpage is almost coincidental.

If you were not designing a web page, you would have & lt; Div & gt; 's should be (and may be) you are creating a table, which your users can fill with the content of their choice.

I'm sure some netrologists will disagree with this answer, but ultimately, the rule is "never used" and lieutenant; Table & gt; , but do not use "never

for the layout" and you are not using it for layout. You are using it to provide a certain structure to fill your users data.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -