1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Testing tables

Examples of the Table code showing some of the attributes.

The Table bb code introduces additional text characters with special meaning. These are described in the special pages help for bb codes but are also recapped here.

Commands can be placed on the line following the Table code. These can be any modifiers that are used with the <table> html tag. In the three examples below width="60%", "header" and border="1" are modifiers of the Table bb code. In subsequent examples cellspacing="0" and style="collapse-border: collapse" are used.

The exclamation mark, when it is the beginning of a line marks the start of contents for a header cell. In addition two exclamation marks mark the beginning of a new cell. Cell level attributes can be used just like they can be in html. To add an attribute to a cell, the cell is divided with the exclamation mark, if it is a header cell, or the vertical bar, if it is a normal table cell. The examples use default values for header cells.

The vertical bar dash combination marks a cell row (|-) when it starts a line. Row attributes are available, but I need to research the actual syntax. They are rarely needed.

The vertical bar at the beginning of a line marks the start of a normal cell. Two vertical bars mark the start of a cell inside a line. Attributes can be added to a cell by separating the cell attributes from its content with a single vertical bar. In the examples below, the width and alignment attributes are used. Table logic dictates that the width only needs to be specified once. The alignment attribute needs to be repeated for each cell it affects.



[Table] width="60%" "header" border="1"
!First Header
!Second Header
!Third Header
|-
|width="30px" align="center"|14
|width="150px" align="center"| Data
|This is the rest of this row with two fixed width cells at the beginning.
|-
|align="right"|25
|Data2
|The cell width will stay the same on following rows.
|- class = "tcat;"
|align="right"|11
|data3
|Some more text in the expected long cell of the table.
[/table]


First HeaderSecond HeaderThird Header
14DataThis is the rest of this row with two fixed width cells at the beginning.
25Data2The cell width should stay the same I believe on following rows.
11data3Some more text in the expected long cell of the table.

As above but cellspacing = "0" in the table definition.

First HeaderSecond HeaderThird Header
14DataThis is the rest of this row with two fixed width cells at the beginning.
25Data2The cell width should stay the same I believe on following rows.
11data3Some more text in the expected long cell of the table.

Added style="border-collapse: collapse"

First HeaderSecond HeaderThird Header
14DataThis is the rest of this row with two fixed width cells at the beginning.
25Data2The cell width should stay the same I believe on following rows.
11data3Some more text in the expected long cell of the table.
Categories: Category Tutorials

This page has been seen 1,876 times.

Current Discussion: Main discussion

  1. No comments have been posted for this discussion.