Close this window

Using the <table> tag

Description

The table tag marks beginning of a table. CNXML uses the CALS Table Model for including tables in CNXML documents. For a more complete description of the CALS Table consult the CALS Table Model Spec.

Example

This CNXML:


<table id="report_card" summary="The first column 
    lists each course. Each row in the second column 
    delineates a semester. The corresponding row in
    the third column shows that semester's grade.  
    The footer tallies the student's average.">
  <title>Report card</title>
  <tgroup cols="3">
    <colspec colnum="1" colname="c1" />
    <colspec colnum="2" colname="c2" />
    <colspec colnum="3" colname="c3" />
    <thead>
      <row>
        <entry>Course</entry>
        <entry>Semester</entry>
        <entry>Grade</entry>
      </row>
    </thead>
    <tfoot>
      <row>
        <entry namest="c1" nameend="c2">
          Average:
        </entry>
        <entry>85.5%</entry>
      </row>
    </tfoot>
    <tbody>
      <row>
        <entry morerows="1">Biology</entry>
        <entry>1</entry>
        <entry>86%</entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>91%</entry>
      </row>
      <row>
        <entry morerows="1">English</entry>
        <entry>1</entry>
        <entry>87%</entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>78%</entry>
      </row>
    </tbody>
  </tgroup>
</table>
        

Results in this display:

Table 1: Report card
Course Semester Grade
Biology 1 86%
2 91%
English 1 87%
2 78%
Average: 85.5%

Attributes(what's this?)

Children(what's this?)

label (one, optional), title (one, optional), tgroup (one or more, required), caption (one, optional)

Parents(what's this?)

content, section, preformat, para, quote, footnote, note, item, figure, subfigure, example, problem, solution, commentary, meaning, statement, proof, entry
Close this window