CSS layout" discussions on Internet have not sense at all! CSS works with tables. But, the truth is that you are not obligated to use all these parameters inline and that TABLE and CSS are two different things that can't be compared. Also, there are additional parameters of TR and TD tags. That opinion originates from the fact that table has a lot of parameters, like border, background, width etc. Very common argument against tables is that table design contains styles in HTML which causes heavy pages. If weight of page is an issue, far more important is to have simple design or optimized images than to use DIV only layout. In this specific case, tables need 34 bytes more. So, this DIV layout costs 221 characters and same TABLE layout takes 255 characters (with spaces). But, it is rarely said how much more HTML code? Let's look at the typical page layout with header, footer and three columns: It is common opinion that tables needs more HTML code than DIV tags. Next important thing is the size of HTML code. Most beginners choose table layout probably because it is easier to understand. Bad design can be made with both tables and divs. It is possible that table layout contains a lot of nested tables, but div layout also could be complicated with a lot of nested divs. Next issue about tables is that tables make layout complicate and hard to maintain. I agree that tables are planned for showing data, but that alone is not good reason to not use tables for layout or any other task if I find them more useful than DIV element. Typical DIV/CSS layout example will look like this:Īlso, there is standard advice that tables are made to show tabular data, not to create layout. Table cell will naturally extend, but DIV will not. This problem also occurs if single word is longer than width of DIV. I agree that I should not place image larger than area of layout, but I like if my layout is unbreakable and ready, just in case. If tables are used, cell that contains large picture will simply elongate which sounds better. If you or users of your CMS place an image larger than DIV, page layout will probably disarrange. I noticed that many CSS layouts have problem with too large images. It is bad if you have many nested elements, either tables or divs. Whatever used, it is important to create your page layout as simple as possible. Tables strike back - CSS/DIV layout has drawbacks? You don't need to start from scratch especially if you are beginner, check, or to find a lot of tested CSS/DIV page layouts which can be used on your web site or just for learning about features of CSS. CSS/DIV layouts have been here for a while and there are a lot of CSS/DIV example layouts ready to use. The good thing is that you don't have to know everything to create your own CSS/DIV page layout. On other side, DIVs are something new and some time is needed to understand concept. People work with tables from elementary school. Tables are everywhere in real life, from price sheet to timetable. One of the reasons of tables' popularity is because beginner is usually already familiar with table term. Simple table cell became page layout area, like header, footer, page navigation, content etc. Suddenly, designers start to use tables to organize elements of web page. This border="0" part removes borders (lines) of table. But, one day, somebody is typed this line: Tables are initially created for showing tabular data, not for creating page layout. By using DIVs with CSS, structure and presentation of page are divided. DIV itself has only align parameter which could be right, left or center. Of course, CSS can be used with tables too, but since DIV tag hasn't much parameters, layout with DIV tag depends completely on CSS, including positioning and size of elements. Although almost any HTML tag could be used, CSS layout is usually based on DIV tags.Īs opposite to CSS layout with DIV tags, there is page layout with TABLE tag without CSS. CSS (Cascading Style Sheets) are one of the popular options for building advanced and manageable page layouts. When someone starts learning of ASP.NET, very soon he or she needs to organize text, controls, images and other page elements to get appropriate and nice looking user interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |