putdocx table — Add tables to an Office Open XML (.docx) file 9
addcols(#
, before | after
) adds # columns to the current table to the right or the left of
column j. If before is specified, the columns are added to the left of the specified column. By
default, the columns are added after, or to the right of, the specified column.
drop deletes row i or column j from the table.
width(#
unit | %
) sets the width of column j. # may be an absolute width or a percentage of the
table width. For example, width(50%) sets the column width to take up 50% of the table width.
When specifying the column width as a percentage, it cannot be greater than 100%.
height(#
unit
, atleast | exact
) sets the height of row i.
atleast means the row will have the minimum height of the specified value. This is the default.
exact means the row will have the exact height of the specified value.
cell fmt options
halign(hvalue) sets the horizontal alignment of the specified cell or of all cells in the specified row,
column, or range. hvalue may be left, right, or center. The default is halign(left).
valign(vvalue) sets the vertical alignment of the specified cell or of all cells in the specified row,
column, or range. vvalue may be top, bottom, or center. The default is valign(top).
border(bordername
, bpattern
, bcolor
, bwidth
) adds a single border to the specified
cell or to all cells in the specified row, column, or range in the given location. bordername may
be start, end, top, bottom, or all. Optionally, you may change the pattern, color, and width
for the border by specifying bpattern, bcolor, and bwidth.
This option may be specified multiple times in a single command to accommodate different border
settings. If multiple border() options are specified, they are applied in the order specified from
left to right.
shading(bgcolor
, fgcolor
, fpattern
) sets the background color, foreground color, and fill
pattern for the specified cell or for all cells in the specified row, column, or range.
nformat(% fmt) applies the Stata numeric format % fmt to the text within the specified cell or within
all cells in the specified row, column, or range. This setting only applies when the content of the
cell is a numeric value.
font(fontname
, size
, color
) sets the font, font size, and font color for the current text within
the specified cell or within all cells in the specified row, column, or range. The font size and font
color may be specified individually without specifying fontname. Use font("", size) to specify
font size only. Use font("", "", color) to specify font color only. For both cases, the default
font will be used.
bold applies bold formatting to the current text within the specified cell or within all cells in the
specified row, column, or range.
italic applies italic formatting to the current text within the specified cell or within all cells in the
specified row, column, or range.
script(sub | super) changes the script style of the current text. script(sub) makes the text a
subscript. script(super) makes the text a superscript. script() may only be specified when
formatting a single cell.
strikeout adds a strikeout mark to the current text within the specified cell or within all cells in
the specified row, column, or range.