Skip to main content

 Element reference

PSML elements from <author> to <xref>

<table>

Summary

The <table> element.

Some block-level elements are allowed in table cells, but neither a <heading> element or a <table> element are valid.

Tables structural elements: <caption><col> , <row> and <cell>.

Usage context

Element categoryblock
PSML levelportable
Permitted content<caption> <col> <row>
Permitted parent<fragment>
HTML equivalent<table>
OpenXML equivalent<w:table>

Attributes

This element supports the following attributes:

Current
NameTypeRequiredDescription
heightlengthnoHeight of table in pixels
rolerolenoCustom value that can be used for formatting
summaryxs:stringnoSummary of tables purpose for non-visual readers
widthlengthnoWidth of table in pixels or percent

The following attributes have been deprecated and might be ignored in future releases:

Deprecated
NameTypeRequiredDescription
borderfixed-lengthnoThe width (in pixels) of the border around table cells
cellpaddingfixed-lengthnoThe number of pixels between the border of the cell and its contents
cellspacingfixed-lengthnoThe number of pixels between the border of the cell and the table frame or other cells

@height

The height of the table in pixels (might have px suffix).

@role

A value to clarify the purpose of a table for formatting or validation. Functionally equivalent to a table style in Word or FrameMaker.

@summary

A summary of the table for non-visual readers.

@width

The width of the table in pixels (px) or percent (%), if neither is present the value is treated as pixels.

Examples

Following is a basic table model with a caption and a header row.

This example is from the Current table above.

<table width="100%">
  <caption>Current</caption>
  <col part="header"/>
  <col/>
  <col/>
  <col/>
  <row  part="header">
    <cell width="120px" align="center">Name</cell>
    <cell width="120px" align="center">Type</cell>
    <cell>Required</cell>
    <cell>Description</cell>
  </row>

  <row>
    <hcell>height</hcell>
    <cell>
      <xref id="556331"
            title="length" frag="5"
            reversefrag="attributes"
            reversetitle="Attributes"
            reverselink="true"
            reversetype="none"
            display="manual"
            type="none"
            uriid="193967"
            href="../datatypes/pageseeder_datatypes.psml"
            urititle="PageSeeder datatypes"
            mediatype="application/vnd.pageseeder.psml+xml">length
      </xref>
    </cell>
    <cell>no</cell>
    <cell>Height of table in pixels.</cell>
  </row>

  <row>
    <hcell>role</hcell>
    <cell>
      <xref id="556332"
            title="role" frag="7"
            reversefrag="attributes"
            reversetitle="Attributes"
            reverselink="true"
            reversetype="none"
            display="manual"
            type="none"
            uriid="193967"
            href="../datatypes/pageseeder_datatypes.psml"
            urititle="PageSeeder datatypes"
            mediatype="application/vnd.pageseeder.psml+xml">role
      </xref>
    </cell>
    <cell>no</cell>
    <cell>Custom value that can be used for formatting.
    </cell>
  </row>
  <row>
    <hcell>summary</hcell>
    <cell>
      <xref id="556333"
            title="xs:string" frag="7"
            reversefrag="attributes"
            reversetitle="Attributes"
            reverselink="true"
            reversetype="none"
            display="manual"
            type="none"
            uriid="193962"
            href="../datatypes/xml_schema_datatypes.psml"
            urititle="XML Schema datatypes"
           mediatype="application/vnd.pageseeder.psml+xml">xs:string
      </xref>
    </cell>
    <cell>no</cell>
    <cell>Summary of tables purpose for non-visual readers.</cell>
  </row>
  <row>
    <hcell>width</hcell>
    <cell>
      <monospace>length</monospace>
    </cell>
    <cell>no</cell>
    <cell>Width of table in pixels or percent.</cell>
  </row>
</table>

Schema

XML Schema

<xs:element name="table">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="caption"
                  maxOccurs="1"
                  minOccurs="0"
                  type="character-style"/>
      <xs:element ref="col" maxOccurs="unbounded" minOccurs="0"/>
      <xs:element ref="row" maxOccurs="unbounded"/>
    </xs:sequence>

    <xs:attribute name="width">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[0-9\.]+(px|%)?"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>

    <xs:attribute name="height">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[0-9]+(px)?"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>

    <xs:attribute name="cellspacing" type="xs:string"/>
    <xs:attribute name="cellpadding" type="xs:string"/>
    <xs:attribute name="border" type="xs:string"/>
    <xs:attribute name="summary" type="xs:string"/>
    <xs:attribute name="role" type="role"/>
  </xs:complexType>
</xs:element>

Relax Schema

element table {
   attribute width { text 
       { pattern="[0-9\.]+(px|%)?" } }?,
   attribute height { text 
       { pattern="[0-9]+(px)?" } }?,
   attribute cellspacing { text }?,
   attribute cellpadding { text }?,
   attribute border { text }?,
   attribute summary { text }?,
   attribute role { role }?,
   element caption?,
   element col*,
   element row+
}

Compatibility

This element was introduced in the first draft of PSML and is well-supported from PageSeeder 5.1.

Created on , last edited on