Showing posts with label Table. Show all posts
Showing posts with label Table. Show all posts

Saturday, December 16, 2017

When And When Not To Use The Html Table Node

When And When Not To Use The Html Table Node
In recent years, with the advent of the XHTML standard -- a subsidiary of the XML standard, people have becoming increasingly hostile toward the use of the table node in HTML documents. Their argument is that it's an ugly HTML node. However, this is being narrow-minded. The table node has a purpose -- and that is to display tabular data. It just so happened that when the border attribute was introduced for the table node, HTML coders began to use the table node for the layout skeleton of their HTML documents. This is naturally an incorrect way for the table node to be used.

The reason people used the table node for their layouts is that a few years ago, there were innumerable amounts of various standards for HTML, and to make matters worse, each browser often implemented their own standards. XHTML was in its infancy, and there was simply a lack of order when it came to HTML and JavaScript alike. Therefore, in a perverse kind of way, it made sense to use the table node, since most browsers could agree on the presentation of the table node.

Then came the standardised era of web-design, with the introduction of XHTML, CSS, etcetera... People began to stay away from using the table node. There still remains a considerable amount of people sitting comfortably at both of the polar-opposites: those who think that using the table node for layouts is still justified, and those that believe one should never use the table node under any circumstances. The former and the latter tend to be associated with the two polar-opposites of HTML coders, too: those who are just beginning to code in HTML, and those that think they know HTML, and are being far too pedantic in their approach. Unfortunately, the latter suffer from a false sense of unsustainable superiority, for which their reason is unjustified.

The one and only purpose of the table node is to display tabular data, as aforementioned. With all these standards, and most browsers complying with them, there is no reason to use the table node for the layout of the HTML document, as this just bloats the HTML document to an unnecessary size, and it is quite unmanageable once you have countless rows and columns in your table. The use of the CSS directive, float, is much preferred in placing elements next to one another. Each and every one of the most commonly used browsers now render HTML documents in pretty much the same way: Internet Explorer (8+), Google Chrome, Opera, Mozilla Firefox, and Safari. For information relating to these browsers, and how common they actually are, one website which provides these invaluable statistics is the W3Schools website.

W3Schools provide crucial information regarding how many people use the most common browsers. As of August 2010, the most commonly used browser, according to W3Schools, is Mozilla Firefox, with Internet Explorer in second place. Both of these browsers, especially in their latest versions -- or somewhere close to their latest versions, support CSS version 2, and the XHTML standard.

Thus, one needs to look at the statistics -- but not take them to be the absolute truth, since statistics don't tell the full story, and then decide in which direction to take with your HTML. It is quite safe to code your HTML documents in the XHTML standard, with CSS version 2. As for the usage of the table node for anything but tabular data -- this is something which, especially these days, would be highly discouraged.


HitReach is a Scottish based company that offers SEO in Angus, web design services, and much, much more. We have a long history of successful clients, and our reputation speaks for itself! Come and see why.




Related Sitemap Xml Articles