Rendering XML with cascading style sheets
<type>prose</type> <date>1906</date> </work> <work> <title>The Raven</title> <author>Edgar Allen Poe</author> <type>prose</type> <date>1845</date> </work> <work> <title>Hamlet</title> <author>William Shakespeare</author> <type>prose</type> <date>1601</date> </work> </catalog>
CSS provides support for tables, but again, present-day browsers do not render tables equally well. To create a table you must you must learn at least three new values for an element's display value:
Using the catalog example above, display: table will be associated with the catalog element, display: ta- ble-row will be associated with the work element, and display: table-cell will be associated with the title, author, type, and date elements.
Additionally, you might want to use these values to make your tables more complete as well as more ac- cessible:
Table-caption is used to give an overall description of the table. Table-header-group is used to denote the labels for the column headings.
Exercise - Displaying XML Using CSS
In this exercise you will learn how to write a CSS file and use it to render an XML file.
Create a CSS file intended to render the file named ala.xml created in a previous exercise.
Open ala.xml in NotePad.
Add the XML processing instruction <?xml-stylesheet href="ala.css" type="text/css"?> to the
top of the file. Save it.