X hits on this document

463 views

0 shares

1 downloads

0 comments

38 / 142

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:

  • 1.

    display: table;

  • 2.

    display: table-row;

  • 3.

    display: table-cell;

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:

  • 1.

    display: table-caption;

  • 2.

    display: table-header-group;

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.

  • 1.

    Create a CSS file intended to render the file named ala.xml created in a previous exercise.

    • A.

      Open ala.xml in NotePad.

    • B.

      Add the XML processing instruction <?xml-stylesheet href="ala.css" type="text/css"?> to the

top of the file. Save it.

30

Document info
Document views463
Page views469
Page last viewedFri Dec 09 14:11:12 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments