Home arrow HTML arrow Page 4 - An Introduction to XHTML

An Introduction to XHTML

XHTML reformulates the existing HTML technology to be an application of XML. It is already used for mobile phone and PDA Internet sites, and expected to gain widespread use as XML becomes more popular. Dan Wellman explains the differences between XHTML and HTML 4, and shows how easy it is to make the switch.

Author Info:
By: Dan Wellman
Rating: 4 stars4 stars4 stars4 stars4 stars / 42
December 01, 2004
  1. · An Introduction to XHTML
  2. · No lazy programming allowed
  3. · Conform to the rules
  4. · The table structure
  5. · Namespace awareness

print this article

An Introduction to XHTML - The table structure
(Page 4 of 5 )

One thing that XHTML has improved upon is the table structure. All table-formatting tags have been deprecated in favour of CSS, but there are several new structural elements that can be used when working with tables. Although these elements could be classed as formatting elements, they are more focused on creating the physical structure and layout of the table rather than changing the appearance of existing table elements.

The new elements are:

  • thead
  • tbody
  • tfoot
  • colgroup
  • col

To see how these elements work, create an XHTML file as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>XHTML Table Elements</title>
      <th colspan="2">XHTML Elements</th>
      <th colspan="2">Rules to Remember<th>
      <td colspan="4">Remember these simple rules and XHTML will be easy!</td>
      <td>Use DTD Declaration</td>
      <td>Close all elements correctly</td>
      <td>Use the namespace declaraton</td>
      <td>nest elements correctly</td>
      <td>Enclose all attributes in quotes</td>

This is an extremely basic example and does not encapsulate all of the XHTML rules of structure and syntax! I have omitted the <colgroup> and <col> elements as these seem to work solely with the "align" attribute, which shouldn't really be used.

The form structure of XHTML is extremely similar to that of HTML with the exception of the File input type. Using this form control will allow users accessing a form to upload files to the server. This control can be used in the following way:

<input type="file" accept="image/*" />

This will allow any image type to be uploaded. The file types that can be entered as values of the accept attribute are MIME types. Additionally, the frameset structure is exactly the same, just remember to use the frameset DTD!

blog comments powered by Disqus

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials