Tables

Document writer <olivier.nicolas@insa-lyon.fr>
vxxx, 2022-xx-xx

1. Tables, examples

1.1. Example 1

1.1.1. Code

[width="40%"]
[cols="<1,^1,>1"]
|===
| Col1 | Col2 | Col3

| A1 | A2 | A3
| B1 | B2 | B3
|===

1.1.2. Result

Col1 Col2 Col3

A1

A2

A3

B1

B2

B3

1.1.3. Comments

The width attribute refers to table vs page.

The cols attribute values (aka specifiers) mean:
"1,1,1" specifies there are three columns, with same width.
"2,2,2" would be equivalent.
"1,2,1" would mean the 2nd column is twice as wide as the other 2.

The <, ^, > specifiers mean respectively: Left Aligned, Centered and Right Aligned.

1.2. Example 2

1.2.1. Code

[width="40%"]
[cols="<1,2,1"]
|===
| Col1 | Col2 | Col3

| A1 | A2 | A3
| B1 | B2 | B3
|===

1.2.2. Result

Col1 Col2 Col3

A1

A2

A3

B1

B2

B3

1.3. Example 3

1.3.1. Code

[cols="1,1,1"]
|===
| A1
| A2
| A3

| B1
| B2
| B3
|===

1.3.2. Result

A1

A2

A3

B1

B2

B3

1.4. Example 4: Nested tables

1.4.1. Code

[cols="1,2a"]
|===
| Col 1 | Col 2

| Cell 1.1
| Cell 1.2

| Cell 2.1
|
[cols="2,1"]
!===
! Col1 ! Col2

! C11
! C12

!===

|===

1.4.2. Result

Col 1 Col 2

Cell 1.1

Cell 1.2

Cell 2.1

Col1 Col2

C11

C12