Tableless web design

Tableless web design

Tableless web design (or tableless web layout) is web design philosophy eschewing the use of HTML tables for page layout control purposes.[1] Instead of HTML tables, style sheet languages such as CSS (Cascading Style Sheets) are used to arrange elements and text on a web page.

CSS was introduced in December 1996 by the W3C to improve web accessibility and to make HTML code semantic rather than presentational. Around the same time, in the late 1990s, as the dot-com boom led to a rapid growth in the 'new media' of web page creation and design, there began a trend of using HTML tables, and their rows, columns and cells, to control the layout of whole web pages. This was due to several reasons:

  • the limitations at the time of CSS support in major browsers;
  • the new web designers' lack of familiarity with CSS;
  • the lack of knowledge of, or concern for the reasons (including HTML semantics and web accessibility) to use CSS instead of what was perceived as an easier way to quickly achieve the intended layouts, and
  • a new breed of WYSIWYG web design tools that encouraged this practice.

More recent times have seen an increasing understanding among web content professionals of the advantages of restricting the use of HTML tables to their intended and semantic purpose — i.e. laying out tabular data or other information. These advantages include improved accessibility of the information to a wider variety of users, using a wide variety of user agents. There are bandwidth savings as large numbers of semantically meaningless <table>, <tr> and <td> tags are removed from dozens of pages leaving fewer, but more meaningful headings, paragraphs and lists. Layout instructions are transferred into site-wide CSS stylesheets, which can be downloaded once and cached for reuse while each visitor navigates the site. Sites become more maintainable as the whole site can be restyled or re-branded in a single pass merely by altering the mark-up of the specific CSS, affecting every page which relies on that stylesheet. New HTML content can be added in such a way that consistent layout rules are immediately applied to it by the existing CSS without any further effort.

There is still (as of 2011) some distance to go; some web developers have yet to remove the tables from their page layouts,[2] while others are now afraid to introduce a simple HTML table even where it makes good sense,[3] some erring by the overuse of span and div elements, perhaps even with table-like rules applied to them using CSS.[4]

Contents

Rationale

HTML was originally designed as a semantic markup language intended for sharing scientific documents and research papers online. However, as the Internet expanded from the academic and research world into the mainstream in the mid-1990s, and became more media oriented, graphic designers sought ways to control the visual appearance of the Web pages presented to end users. To this end, tables and spacers (usually transparent single pixel GIF images with explicitly specified width and height) have been used to create and maintain page layout.

This causes a number of problems. Many Web pages have been designed with tables nested within tables, resulting in large HTML documents which use more bandwidth than documents with simpler formatting. Furthermore, when a table-based layout is linearized, for example when being parsed by a screen reader or a search engine, the resulting order of the content can be somewhat jumbled and confusing.

In the late 1990s the first reasonably powerful WYSIWYG editors arrived on the market, which meant Web designers no longer needed a technical understanding of HTML to build web pages. Such editors indirectly encourage extensive use of nested tables to position design elements. As designers edit their documents in these editors, code is added to the document which is sometimes unnecessary. Furthermore, unskilled designers may use tables more than required when using a WYSIWYG editor. This practice can lead to many tables nested within tables as well as tables with unnecessary rows and columns.

The use of graphic editors with slicing tools that output HTML and images directly also promote poor code with tables often having many rows of 1 pixel height or width. Sometimes many more lines of code are used to render content than the actual content itself.

As the dotcom boom receded in 2001 and the Web development industry shrank, coders with more industry experience were in higher demand. In a large number of cases UI development was carried out by coders with greater knowledge of good coding practice. It was around this time that many became critical of messy coding practices and the idea of tableless design began to grow.[5]

Cascading Style Sheets (CSS) were developed to improve the separation between design and content, and move back towards a semantic organization of content on the Web. The term "tableless design” implies the use of CSS rather than layout tables to position HTML elements on the page. HTML tables still have their legitimate place when presenting out tabular information within web pages.[3]

Advantages

Accessibility

Because of the Internet's rapid growth, disability discrimination legislation, and the increasing use of mobile phones and PDAs, it is necessary for Web content to be made accessible to users operating a wide variety of devices. Tableless Web design considerably improves Web accessibility in this respect.

Screen readers and braille devices have fewer problems with tableless designs because they follow a logical structure. The same is true for search engine Web crawlers, the software agents that most web site publishers hope will find their pages, classify them accurately and so enable potential users to find them easily in appropriate searches.[6]

As a result of the separation of design (CSS) and structure (HTML), it is also possible to provide different layouts for different devices, e.g. handhelds, mobile phones, etc. It is also possible to specify a different style sheet for print, e.g. to hide or modify the appearance of advertisements or navigation elements that are irrelevant and a nuisance in the printable version of the page.

The W3C's Web Content Accessibility Guidelines' guideline no. 3 states "use markup and style sheets and do so properly."[7] The guideline's checkpoint 3.3, a priority-2 checkpoint, says "use style sheets to control layout and presentation."[8]

Bandwidth savings

Tableless design produces web pages with fewer HTML tags used purely to position content. This normally means that the pages themselves become smaller to download. The philosophy implies that all the instructions regarding layout and positioning be moved into external style sheets. According to the basic capabilities of HTTP, as these rarely change and they apply in common to many web pages, they will be cached and reused after the first download. This further reduces bandwidth and download times across the site.[9][10]

Maintainability

Maintaining a website may require frequent changes, both small and large, to the visual style of a website, depending on the purpose of the site. Under table-based layout, the layout is part of the HTML itself. As such, without the aid of template-based visual editors such as HTML editors, changing the positional layout of elements on a whole site may require a great deal of effort, depending on the amount of repetitive changes required. Even employing sed or similar global find-and-replace utilities cannot alleviate the problem entirely.

In tableless layout using CSS, virtually all of the layout information resides in one place: the CSS document. Because the layout information is centralized, these changes can be made quickly and globally by default. The HTML files themselves do not usually need to be adjusted when making layout changes. If they do, it is usually to add class-tags to specific markup elements or to change the grouping of various sections with respect to one another.

Also, because the layout information is stored externally to the HTML, it is quite easy to add new content in a tableless design, whether modifying an existing page or adding a new page. By contrast, without such a design, the layout for each page may require a more time-consuming manual changing of each instance or use of global find-and-replace utilities. However site owners often want particular pages to be different from others on the site either for a short period or long term. This will often necessitate a separate style sheet to be developed for that page.

On the other hand, due to browser inconsistency and a particular web designer's implementation of tableless design, it may not be clear at first glance exactly how a tableless web page is constructed. While it is convenient to have markup language residing in a single CSS file, it can split layout logic unnecessarily. Browser inconsistencies can increase the risk of web pages failing to render properly which increases the need for maintainability.

The use of tables

On the one hand, because of the term "tableless web design", some have interpreted this design strategy as an unconditional repudiation of all tables in web design. This has caused some to avoid tables even when tables are appropriate. Using divisions to simulate a table for the display of tabular data is as much a design flaw as using tables to control graphic and page layout. Some sources clarify this distinction by using the more specific term "tableless web layout".[1]

On the other hand, using tables in web design, although most common, does not necessarily equate to using the table element defined in HTML 4.0. CSS also specifies a "table model" which allows the layout of tables to be applied to any element using the "display: table" CSS declaration.[11] One reason this technique is sometimes overlooked is the lack of support for the CSS table model in Internet Explorer versions earlier than 8. Internet Explorer 8 is the first version of the browser to support the CSS table model.

See also

Notes and references

  1. ^ a b The term "tableless web design" refers to avoiding tables as a means of specifying general page or screen layout; they are a means for specifying and laying out tabular data Dominique Hazaël-Massieux (2005). "Tableless layout HOWTO". W3C. http://www.w3.org/2002/03/csslayout-howto. Retrieved 2007-09-08. 
  2. ^ Robert Darrell. "Using Tables for Layout". Iron Spider. http://www.ironspider.ca/webdesign102/tables4layout.htm. Retrieved 2009-10-22. 
  3. ^ a b Jennifer Kyrnin. "Tables for Tabular Data — What is Tabular Data? When to Use Tables in a Standards-Based XHTML Document". About.com, a part of The New York Times Company. http://webdesign.about.com/od/tables/a/aa122605.htm. Retrieved 2009-10-22. 
  4. ^ "17.2.1 Anonymous table objects". Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. W3C. 2009. http://www.w3.org/TR/CSS2/tables.html#anonymous-boxes. Retrieved 2009-10-23. 
  5. ^ Michael Eisenbraun. "CSS is in the Garden: How CSS Zen Garden Changed Web Design". http://www.michaeleisenbraun.com/portfolio/literary_css.pdf. Retrieved 2009-10-23. "However, by 2002, few CSS control sites existed and none of them were tapping into the true potential of CSS. It was at this time that Dave Shea, with a background in both programming and visual design, began formulating his plans to change all that." 
  6. ^ "Semantically Correct HTML". Semantic HTML. http://semantichtml.org/home/. Retrieved 2009-09-19. 
  7. ^ "Web Content Accessibility Guidelines 1.0". W3C. 1999. http://www.w3.org/TR/WAI-WEBCONTENT/#gl-structure-presentation. Retrieved 2009-09-19. "Guideline 3. Use markup and style sheets and do so properly." 
  8. ^ "Techniques for Web Content Accessibility Guidelines 1.0". W3C. 2000. http://www.w3.org/TR/WCAG10-TECHS/#tech-style-sheets. Retrieved 2009-09-19. "Use style sheets to control layout and presentation." 
  9. ^ Daniel M. Frommelt (2003). "Retooling Slashdot with Web Standards". A List Apart Magazine. http://www.alistapart.com/articles/slashdot/. Retrieved 2009-09-20. 
  10. ^ Dan Shafer (2003). "HTML Utopia: Designing Without Tables Using CSS, Chapter 4: CSS Website Design". SitePoint Pty. http://www.sitepoint.com/print/css-4-css-website-design/. Retrieved 2009-09-20. "...on top of the organizational advantages described above, the browser has less code to download. On heavily designed sites, or sites with hundreds of pages or more, this reduced download time can have a significant impact both on the user experience, and on your bandwidth costs." 
  11. ^ "CSS table model". http://www.w3.org/TR/CSS21/tables.html. Retrieved 2007-09-08. 

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Slicing (web design) — In web development, slicing is the process of dividing a single web page user interface composition layout (web page comp) into multiple image files (digital assets) of the graphical user interface (GUI) for one or more web pages. It is typically …   Wikipedia

  • Framing (World Wide Web) — HTML HTML and HTML5 Dynamic HTML XHTML XHTML Mobile Profile and C HTML Canvas element Character encodings Document Object Model Font family HTML editor HTML element HTML Frames HTML5 video …   Wikipedia

  • Cascading Style Sheets — CSS redirects here. For other uses, see CSS (disambiguation). For the use of CSS on Wikipedia, see Help:Cascading style sheets. Cascading Style Sheets Filename extension .css Internet media type text/css Developed by World Wide Web Consortium …   Wikipedia

  • Вёрстка веб-страниц — Вёрстка веб страниц  процесс формирования веб страниц в текстовом либо WYSIWYG редакторе, а также результат этого процесса, то есть собственно веб страницы. По принципам использования средств разметки HTML различают логическую разметку и… …   Википедия

  • CSS framework — A CSS framework is a pre prepared library that is meant to allow for easier, more standards compliant styling of a webpage using the Cascading Style Sheets language. Just like programming and scripting language libraries, CSS frameworks (usually… …   Wikipedia

  • CSS Zen Garden — URL csszengarden.com Launched May 2003 Cascading Style Sheets CSS Animations Dynamic CSS Comparison of layout engines Comparison of stylesheet languages …   Wikipedia

  • Comparison of HTML editors — The following tables compare general and technical information for a number of HTML editors. This article is not all inclusive or necessarily up to date. Please see the individual products articles for further information, and Comparison of text… …   Wikipedia

  • Comparison of layout engines (Cascading Style Sheets) — Cascading Style Sheets CSS Animations Dynamic CSS Comparison of layout engines Comparison of stylesheet languages Internet Explorer box model bug CSS Zen Garden The Zen of CSS Design CSSTidy Style sheet Tableless web design Holy Grail (web… …   Wikipedia

  • Comparison of stylesheet languages — Cascading Style Sheets CSS Animations Dynamic CSS Comparison of layout engines Comparison of stylesheet languages Internet Explorer box model bug CSS Zen Garden The Zen of CSS Design CSSTidy Style sheet Tableless web design Holy Grail (web… …   Wikipedia

  • Dynamic Cascading Style Sheets — Cascading Style Sheets CSS Animations Dynamic CSS Comparison of layout engines Comparison of stylesheet languages Internet Explorer box model bug CSS Zen Garden The Zen of CSS Design CSSTidy Style sheet Tableless web design Holy Grail (web… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”