开发者

using table as a layout [duplicate]

This question already has answers here: 开发者_StackOverflow Closed 12 years ago.

Possible Duplicate:

Why not use tables for layout in HTML?

i know that using tables as layout is a big problem..Why don’t professional web designers use tables for layout anymore? and what are the alternatives in CSS that i can use and will be the best alternative to tables??


1) as soon as a browser sees an opening table tag, it will stop rendering until it sees the closing tag, since it has no way of even guessing what the table structure will look like. Because of that, tables will dramatically increase the wait time between when the user starts the request, and when they can actually use your page.

2) tables require 3 nested tags to define a cell, which is a hell of a lot of noise in an already incredibly verbose language (xml)

3) semantically, a table is for tabular data. using it for layout means your html doesn't make sense when you read it.


  1. Discussed here - Why not use tables for layout in HTML?

  2. CSS doesn't provide 'alternatives' to tables. It is used to style HTML elements including tables.


Try to learn using div tag and giving style to it using css..it has more effect in look


I would definitely suggest using CSS and XHTML to layout pages.

I think there are far too many benefits to go into here. Ranging from accessibility, SEO, ease of coding to future proofing. I think blog posts and articles on the subject will be able to provide more information on why and how you should use CSS instead of table to layout pages.

One book I would suggest is Web Standards Solutions: The Markup and Style Handbook by Dan Cederholm This book will tell you everything you need to know about using CSS and HTML in a web standards compliant way.

One thing to keep in mind is that HTML5 is starting to gain widespread usage there are a few differences and added features that differ from XHTML

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜