Table Syntax and Attribute Reference

Attribute Description Value Description Notes

caption

defines the title label on a single table

user-defined

cols

comma-separated list of column specifiers

specifiers

Specifies the number of columns and the distribution ratio and default formatting for each column. See Add Columns to a Table for details

format

data format of the table’s contents

psv

cells are delimited by separator (default |) (aka prefix-separated values)

dsv

cells are delimited by a colon (:) (aka delimiter-separated values)

csv

cells are delimited by a comma (,) (aka comma-separated values)

tsv

cells are delimited by a tab character (aka tab-separated values)

separator

character used to separate cells

|

default for top-level tables

!

default for nested tables

user-defined

any single character or \t for tab (e.g., ¦ or %). Ideally a character not found in the cell content.

frame

draws a border around the table

all

border on all sides (default)

ends

border on top and bottom ends

none

no borders

sides

border on left and right sides

grid

draws boundary lines between rows and columns

all

draws boundary lines around each cell (default)

cols

draws boundary lines between columns

rows

draws boundary lines between rows

none

no boundary lines

stripes

controls row shading (via background color)

none

no rows are shaded (default)

even

even rows are shaded

odd

odd rows are shaded

hover

row under the mouse cursor is shaded (HTML only)

all

all rows are shaded

align

horizontally aligns a table with restricted width

left

aligns to left side of page (default)

Not recognized by Asciidoctor. To align the table, use an alignment role (e.g., [role=center] or [.center]). The alignment roles work for both HTML and PDF output. Alignment roles and the float attributes are mutually exclusive.

right

aligns to right side of page

center

horizontally aligns to center of page

float

floats the table to the specified side of the page

left

floats the table to the left side of the page (default)

Applies to HTML output only. Must be used in conjunction with the table’s width attribute to take effect. The float and align attributes are mutually exclusive.

right

floats the table to the right side of the page

halign

horizontally aligns all of the cell contents in a table

left

aligns the contents of the cells to the left (default)

Not recognized by Asciidoctor. Define instead using column or cell specifiers (e.g., 3*>), which take precedence over this value.

right

aligns the contents of the cells to the right

center

aligns the contents to the cell centers

valign

vertically aligns all of the cell contents in a table

top

aligns the cell contents to the top of the cell (default)

Not recognized by Asciidoctor. Define instead using column or cell specifiers (e.g., 3*.>), which take precedence over this value.

bottom

aligns the cell contents to the bottom of the cell

middle

aligns the cell contents to the middle of the cell

orientation

rotates the table

landscape

rotated 90 degrees counterclockwise

Equivalent to setting the rotate option, which is preferred. DocBook only.

options

comma separated list of option names

header

promotes first row to the table header

header and footer rows are omitted by default

footer

promotes last row to the table footer

breakable

allows the table to split across a page (default)

Mutually exclusive. DocBook only (specifically for generating PDF output).

unbreakable

prevents the table from being split across a page

autowidth

disables explicit column widths (ignores distribution ratios in cols attribute)

rotate

Prints the table in landscape

Equivalent to setting the orientation to landscape. DocBook only.

role

comma-separated list of role names

left

floats the table to the left margin

The role is the preferred way to specify the alignment of a table with restricted width. May be specified using role shorthand (e.g., [.center]).

right

floats the table to the right

center

aligns the table to center

stretch

stretches an autowidth table to the width of the page

width

the table width relative to the available page width

user defined value

a percentage value between 0% and 100%