PSML

A complete reference of PageSeeder's markup language PSML

<table>

Summary

The <table> element.

Warning!

This element has been changed in PSML Beta 7, some attributes have been deprecated and columns can be specified.

Restrictions on content

Although, table cells can contain some block-level elements, tables must not contain headings <heading> or a nested table <table>.

Usage context

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

Attributes

This element includes 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 attributes below have been deprecated and may not be available in the future:

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 (may have px suffix).

@role

A role for the table which can be used for formatting.

@summary

A summary of the table for non-visual readers.

@width

The width of the table in pixels or percent (pixels if no px or % suffix).

Examples

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

This example is from the Current table above.

<table>
  <caption>Current</caption>
    <col part="header"/>
    <col/>
    <col/>
    <col/>
<row part="header">
<cell>Name</cell>
<cell>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.

Columns were introduced in PSML beta 7.

See also

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

Created on , last edited on