smpl_doc.doc.table

smpl_doc.doc.table(dic, top=True, bottom=True, init=True, tabs=1)[source]

Add dict= {‘key’: [values…]} to a simple reST table.

Parameters

dicdict

Dictionary to be converted to a table.

topbool

If True a top line is added.

bottombool

If True a bottom line is added.

initbool

If True a tab is added at the beginning of the line.

tabsint

Number of tabs to be added at the beginning of the line.

Returns

str

The table as a string.

Examples

>>> table({'a': [1, 2, 3], 'b': [4, 5, 6]})
'\t==================  ==================  ==================\n\ta                   1                   2                   3\n\tb                   4                   5                   6\n\t==================  ==================  ==================\n\t\n'

Deprecated since version 1.0.3.1: This will be removed in ?.?.?. Use smpl_doc.array_table() instead.