colspec
Typ
Struktur-Element (Formatierung)
Zulässige Kind-Elemente:
keine
Unterstütze Attribute
-
align (optional): Horizontale Ausrichtung der Zellen, left, center oder right. Default-Wert: center
-
column: Ganze Zahl die angibt, auf welche Spalte sich die colspec-Formatierungsanweisungen beziehen sollen. Die Nummerierung der Spalten beginnt links mit der Zahl 1.
-
fixed (optional): Boolescher Wert der angibt, ob die Spalte fixiert werden soll, d.h. diese beim horizontalen Scrollen in der Tabelle immer angezeigt werden soll. Dies ist nur für die linken Spalten möglich, bis die erste nicht fixierte Spalte auftritt. Default-Wert: false
-
maxwidth (optional): Wert der angibt, wie Breit die Spalte maximal werden darf. Default-Wert: none
-
minwidth (optional): Wert der angibt, wie Breit die Spalte mindestens breit sein soll. Default-Wert: auto
-
sortedby (optional): Wert der angibt, ob und wie (ascending oder descending) die Tabelle aufgrund dieser Spalte sortiert werden soll, vorausgesetzt bei table wurde das sortable-Attribut mit dem Wert true versehen und ein headrow-Element existiert. Default-Wert: none
weitere Informationen zur Syntax
Beschreibung
Ein colspec-Element dient dazu, eine Spalte einer Tabelle näher zu beschreiben, insbesondere Ausrichtung und Größe.
Code-Beispiele
<table>
<colspecs>
<colspec column="1" align="right"/>
</colspecs>
<headrow>
<cell><p>header A</p></cell>
<cell><p>header B</p></cell>
<cell><p>header C</p></cell>
<cell><p>header D</p></cell>
<cell><p>header E</p></cell>
<cell><p>header F</p></cell>
</headrow>
<row>
<cell><p>A1</p></cell>
<cell><p>B1</p></cell>
<cell><p>C1</p></cell>
<cell><p>D1</p></cell>
<cell><p>E1</p></cell>
<cell><p>F1</p></cell>
</row>
<row>
<cell><p>A2</p></cell>
<cell><p>B2</p></cell>
<cell><p>C2</p></cell>
<cell><p>D2</p></cell>
<cell><p>E2</p></cell>
<cell><p>F2</p></cell>
</row>
<row>
<cell><p>A3</p></cell>
<cell><p>B3</p></cell>
<cell><p>C3</p></cell>
<cell><p>D3</p></cell>
<cell><p>E3</p></cell>
<cell><p>F3</p></cell>
</row>
</table>
<table>
<colspecs>
<colspec column="1" fixed="true" minwidth="250px"/>
<colspec column="2" minwidth="250px"/>
<colspec column="3" minwidth="250px"/>
<colspec column="4" minwidth="250px"/>
<colspec column="5" minwidth="250px"/>
<colspec column="6" minwidth="250px"/>
</colspecs>
<headrow>
<cell><p>header A</p></cell>
<cell><p>header B</p></cell>
<cell><p>header C</p></cell>
<cell><p>header D</p></cell>
<cell><p>header E</p></cell>
<cell><p>header F</p></cell>
</headrow>
<row>
<cell><p>A1</p></cell>
<cell><p>B1</p></cell>
<cell><p>C1</p></cell>
<cell><p>D1</p></cell>
<cell><p>E1</p></cell>
<cell><p>F1</p></cell>
</row>
<row>
<cell><p>A2</p></cell>
<cell><p>B2</p></cell>
<cell><p>C2</p></cell>
<cell><p>D2</p></cell>
<cell><p>E2</p></cell>
<cell><p>F2</p></cell>
</row>
<row>
<cell><p>A3</p></cell>
<cell><p>B3</p></cell>
<cell><p>C3</p></cell>
<cell><p>D3</p></cell>
<cell><p>E3</p></cell>
<cell><p>F3</p></cell>
</row>
</table>
<table>
<colspecs>
<colspec column="1" maxwidth="2em"/>
<colspec column="2" maxwidth="2em"/>
<colspec column="3" maxwidth="2em"/>
<colspec column="4" maxwidth="2em"/>
<colspec column="5" maxwidth="2em"/>
<colspec column="6" maxwidth="2em"/>
</colspecs>
<headrow>
<cell><p>header A</p></cell>
<cell><p>header B</p></cell>
<cell><p>header C</p></cell>
<cell><p>header D</p></cell>
<cell><p>header E</p></cell>
<cell><p>header F</p></cell>
</headrow>
<row>
<cell><p>A1</p></cell>
<cell><p>B1</p></cell>
<cell><p>C1</p></cell>
<cell><p>D1</p></cell>
<cell><p>E1</p></cell>
<cell><p>F1</p></cell>
</row>
<row>
<cell><p>A2</p></cell>
<cell><p>B2</p></cell>
<cell><p>C2</p></cell>
<cell><p>D2</p></cell>
<cell><p>E2</p></cell>
<cell><p>F2</p></cell>
</row>
<row>
<cell><p>A3</p></cell>
<cell><p>B3</p></cell>
<cell><p>C3</p></cell>
<cell><p>D3</p></cell>
<cell><p>E3</p></cell>
<cell><p>F3</p></cell>
</row>
</table>
<table sortable="true">
<colspecs>
<colspec column="1" sortedby="descending"/>
</colspecs>
<headrow>
<cell><p>header A</p></cell>
<cell><p>header B</p></cell>
<cell><p>header C</p></cell>
<cell><p>header D</p></cell>
<cell><p>header E</p></cell>
<cell><p>header F</p></cell>
</headrow>
<row>
<cell><p>A1</p></cell>
<cell><p>B1</p></cell>
<cell><p>C1</p></cell>
<cell><p>D1</p></cell>
<cell><p>E1</p></cell>
<cell><p>F1</p></cell>
</row>
<row>
<cell><p>A2</p></cell>
<cell><p>B2</p></cell>
<cell><p>C2</p></cell>
<cell><p>D2</p></cell>
<cell><p>E2</p></cell>
<cell><p>F2</p></cell>
</row>
<row>
<cell><p>A3</p></cell>
<cell><p>B3</p></cell>
<cell><p>C3</p></cell>
<cell><p>D3</p></cell>
<cell><p>E3</p></cell>
<cell><p>F3</p></cell>
</row>
</table>