Question

I have a question, basically I need to write the code for a table with minimal XHTML and CSS. I'm not quite sure what minimal XHTML is but my guess is that it's just showing the initial XML code without the doc type etc. That's what a site says.

But then all the examples of minimal XHTML contain the strict, transitional and frameset document types which is confusing me because wouldn't that just make it a normal XML page then?

Was it helpful?

Solution

Minimal XHTML is what is at least required as w3c recomendations, to be included in such type of document. You can find details here w3c

I quote the most relevant of it...

The root element of the document must be html.

The root element of the document must contain an xmlns declaration for the XHTML namespace [XMLNS]. The namespace for XHTML is defined to

be http://www.w3.org/1999/xhtml. An example root element might look like:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

There must be a DOCTYPE declaration in the document prior to the root element. The public identifier included in the DOCTYPE

declaration must reference one of the three DTDs found in DTDs using the respective Formal Public Identifier. The system identifier may be changed to reflect local system conventions.

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

The DTD subset must not be used to override any parameter entities in the DTD.

OTHER TIPS

The question being: "(a)Illustrate using minimal XHTML and CSS how you would layout a data table like the following..." then it shows a table.

As a teacher—and if that's all you have to go on—I would read that as: "Show the basic HTML and CSS needed to construct this table, without adding unnecessary details." Presumably the examiner doesn't want to trawl through a lot of fancy code that shows off your skills but that isn't really needed to demonstrate you know how to code a table appropriately.

In principle, the most logical interpretation of “minimal” is “using the smallest amount of characters”. Probably line breaks are not counted, however; omitting them would make the code essentially less convenient to read. The problem still isn’t well-defined, since it does not define what XHTML version(s) may be used.

If XHTML linearization (syntax) for HTML5, known as XHTML5, is allowed, then the minimal XHTML document containing a table and reference to a style sheet is the following (when line breaks are not counted:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<link rel="stylesheet" href="a.css"/></head>
<body>
<table><tr><td></td></tr></table>
</body>
</html>

Techically the style sheet URL could be shorter, but it’s not reasonable to use a URL that does not end with .css.

Other XTHML versions have different rules, resulting in a somewhat longer minimal document, due to the length of the doctype declaration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top