<spanid="evennia-utils-evtable"></span><h1>evennia.utils.evtable<aclass="headerlink"href="#module-evennia.utils.evtable"title="Permalink to this headline">¶</a></h1>
<p>This is an advanced ASCII table creator. It was inspired by Prettytable
(<aclass="reference external"href="https://code.google.com/p/prettytable/">https://code.google.com/p/prettytable/</a>) but shares no code and is considerably
more advanced, supporting auto-balancing of incomplete tables and ANSI colors among
<spanclass="n">table</span><spanclass="o">.</span><spanclass="n">add_column</span><spanclass="p">(</span><spanclass="s2">"This is long data"</span><spanclass="p">,</span><spanclass="s2">"This is even longer data"</span><spanclass="p">)</span>
<spanclass="n">table</span><spanclass="o">.</span><spanclass="n">add_row</span><spanclass="p">(</span><spanclass="s2">"This is a single row"</span><spanclass="p">)</span>
<p>This is a wrapper work class for handling strings with ANSI tags
in it. It overloads the standard library <strong>TextWrapper</strong> class and
is used internally in <strong>EvTable</strong> and has no public methods.</p>
</dd></dl>
<dlclass="py function">
<dtid="evennia.utils.evtable.wrap">
<codeclass="sig-prename descclassname">evennia.utils.evtable.</code><codeclass="sig-name descname">wrap</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span></em>, <emclass="sig-param"><spanclass="n">width</span><spanclass="o">=</span><spanclass="default_value">78</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#wrap"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.wrap"title="Permalink to this definition">¶</a></dt>
<dd><p>Wrap a single paragraph of text, returning a list of wrapped lines.</p>
<p>Reformat the single paragraph in ‘text’ so it fits in lines of no
more than ‘width’ columns, and return a list of wrapped lines. By
default, tabs in ‘text’ are expanded with string.expandtabs(), and
all other whitespace characters (including newline) are converted to</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>text</strong> (<em>str</em>) – Text to wrap.</p></li>
<li><p><strong>width</strong> (<em>int</em><em>, </em><em>optional</em>) – Width to wrap <strong>text</strong> to.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>TextWrapper class for available keyword args to customize</strong> (<em>See</em>) –</p></li>
<codeclass="sig-prename descclassname">evennia.utils.evtable.</code><codeclass="sig-name descname">fill</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span></em>, <emclass="sig-param"><spanclass="n">width</span><spanclass="o">=</span><spanclass="default_value">78</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#fill"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.fill"title="Permalink to this definition">¶</a></dt>
<dd><p>Fill a single paragraph of text, returning a new string.</p>
<p>Reformat the single paragraph in ‘text’ to fit in lines of no more
than ‘width’ columns, and return a new string containing the entire
wrapped paragraph. As with wrap(), tabs are expanded and other
whitespace characters converted to space.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>text</strong> (<em>str</em>) – Text to fill.</p></li>
<li><p><strong>width</strong> (<em>int</em><em>, </em><em>optional</em>) – Width of fill area.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>TextWrapper class for available keyword args to customize</strong> (<em>See</em>) –</p></li>
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.evtable.</code><codeclass="sig-name descname">EvCell</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell"title="Permalink to this definition">¶</a></dt>
<p>Holds a single data cell for the table. A cell has a certain width
and height and contains one or more lines of data. It can shrink
and resize as needed.</p>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvCell.__init__">
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.__init__"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>data</strong> (<em>str</em>) – The un-padded data of the entry.</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>width</strong> (<em>int</em>) – Desired width of cell. It will pad
to this size.</p></li>
<li><p><strong>height</strong> (<em>int</em>) – Desired height of cell. it will pad
to this size.</p></li>
<li><p><strong>pad_width</strong> (<em>int</em>) – General padding width. This can be overruled
by individual settings below.</p></li>
<li><p><strong>pad_left</strong> (<em>int</em>) – Number of extra pad characters on the left.</p></li>
<li><p><strong>pad_right</strong> (<em>int</em>) – Number of extra pad characters on the right.</p></li>
<li><p><strong>pad_top</strong> (<em>int</em>) – Number of extra pad lines top (will pad with <strong>vpad_char</strong>).</p></li>
<li><p><strong>pad_bottom</strong> (<em>int</em>) – Number of extra pad lines bottom (will pad with <strong>vpad_char</strong>).</p></li>
<li><p><strong>pad_char</strong> (<em>str</em>) – by individual settings below (default <strong>” “</strong>).</p></li>
<li><p><strong>hpad_char</strong> (<em>str</em>) – Pad character to use both for extra horizontal
padding (default <strong>” “</strong>).</p></li>
<li><p><strong>vpad_char</strong> (<em>str</em>) – Pad character to use for extra vertical padding
and for vertical fill (default <strong>” “</strong>).</p></li>
<li><p><strong>fill_char</strong> (<em>str</em>) – Character used to filling (expanding cells to
desired size). This can be overruled by individual settings below.</p></li>
<li><p><strong>hfill_char</strong> (<em>str</em>) – Character used for horizontal fill (default <strong>” “</strong>).</p></li>
<li><p><strong>vfill_char</strong> (<em>str</em>) – Character used for vertical fill (default <strong>” “</strong>).</p></li>
<li><p><strong>align</strong> (<em>str</em>) – Should be one of “l”, “r”, “c”, “f” or “a” for left-, right-, center-,
full-justified (with space between words) or absolute (keep as much original
whitespace as possible). Default is left-aligned.</p></li>
<li><p><strong>valign</strong> (<em>str</em>) – Should be one of “t”, “b” or “c” for top-, bottom and center
vertical alignment respectively. Default is centered.</p></li>
<li><p><strong>border_width</strong> (<em>int</em>) – General border width. This is overruled
by individual settings below.</p></li>
<li><p><strong>border_left</strong> (<em>int</em>) – Left border width.</p></li>
<li><p><strong>border_right</strong> (<em>int</em>) – Right border width.</p></li>
<li><p><strong>border_top</strong> (<em>int</em>) – Top border width.</p></li>
<codeclass="sig-name descname">get_min_height</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.get_min_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.get_min_height"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the minimum possible height of cell, including at least
one line for data.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>min_height (int)</em>– The mininum height of cell.</p>
<codeclass="sig-name descname">get_min_width</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.get_min_width"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.get_min_width"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the minimum possible width of cell, including at least one
character-width for data.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>min_width (int)</em>– The minimum width of cell.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvCell.get_height">
<codeclass="sig-name descname">get_height</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.get_height"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.get_height"title="Permalink to this definition">¶</a></dt>
<dd><p>Get natural height of cell, including padding.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>natural_height (int)</em>– Height of cell.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvCell.get_width">
<codeclass="sig-name descname">get_width</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.get_width"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.get_width"title="Permalink to this definition">¶</a></dt>
<dd><p>Get natural width of cell, including padding.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>natural_width (int)</em>– Width of cell.</p>
<codeclass="sig-name descname">replace_data</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.replace_data"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.replace_data"title="Permalink to this definition">¶</a></dt>
<dd><p>Replace cell data. This causes a full reformat of the cell.</p>
<p>The available keyword arguments are the same as for
<strong>EvCell.__init__</strong>.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvCell.reformat">
<codeclass="sig-name descname">reformat</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.reformat"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.reformat"title="Permalink to this definition">¶</a></dt>
<dd><p>Reformat the EvCell with new options</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>available keyword arguments are the same as for EvCell.__init__.</strong> (<em>The</em>) –</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>Exception</strong>– If the cells cannot shrink enough to accomodate
the options or the data given.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvCell.get">
<codeclass="sig-name descname">get</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvCell.get"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvCell.get"title="Permalink to this definition">¶</a></dt>
<dd><p>Get data, padded and aligned in the form of a list of lines.</p>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.evtable.EvColumn">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.evtable.</code><codeclass="sig-name descname">EvColumn</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvColumn"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvColumn"title="Permalink to this definition">¶</a></dt>
<p>This class holds a list of Cells to represent a column of a table.
It holds operations and settings that affect <em>all</em> cells in the
column.</p>
<p>Columns are not intended to be used stand-alone; they should be
incorporated into an EvTable (like EvCells)</p>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvColumn.__init__">
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvColumn.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvColumn.__init__"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>for each row in the column</strong> (<aclass="reference internal"href="evennia.utils.optionclasses.html#evennia.utils.optionclasses.Text"title="evennia.utils.optionclasses.Text"><em>Text</em></a>) –</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>EvCell.__init_ keywords are available</strong><strong>, </strong><strong>these</strong> (<em>All</em>) –</p></li>
<li><p><strong>will be persistently applied to every Cell in the</strong> (<aclass="reference internal"href="evennia.utils.logger.html#evennia.utils.logger.EvenniaLogFile.settings"title="evennia.utils.logger.EvenniaLogFile.settings"><em>settings</em></a>) –</p></li>
<li><p><strong>column.</strong>–</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvColumn.add_rows">
<codeclass="sig-name descname">add_rows</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvColumn.add_rows"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvColumn.add_rows"title="Permalink to this definition">¶</a></dt>
<dd><p>Add new cells to column. They will be inserted as
a series of rows. It will inherit the options
of the rest of the column’s cells (use update to change
options).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>for the new cells</strong> (<em>Texts</em>) –</p></li>
<li><p><strong>ypos</strong> (<em>int</em><em>, </em><em>optional</em>) – Index position in table before which to insert the
new column. Uses Python indexing, so to insert at the top,
use <strong>ypos=0</strong>. If not given, data will be inserted at the end
of the column.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>keywods as per EvCell.__init__.</strong> (<em>Available</em>) –</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvColumn.reformat">
<codeclass="sig-name descname">reformat</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvColumn.reformat"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvColumn.reformat"title="Permalink to this definition">¶</a></dt>
<dd><p>Change the options for the column.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>as per EvCell.__init__.</strong> (<em>Keywords</em>) –</p>
<codeclass="sig-name descname">reformat_cell</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">index</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvColumn.reformat_cell"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvColumn.reformat_cell"title="Permalink to this definition">¶</a></dt>
<dd><p>reformat cell at given index, keeping column options if
necessary.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>index</strong> (<em>int</em>) – Index location of the cell in the column,
starting from 0 for the first row to Nrows-1.</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>as per EvCell.__init__.</strong> (<em>Keywords</em>) –</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.utils.evtable.EvTable">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.utils.evtable.</code><codeclass="sig-name descname">EvTable</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable"title="Permalink to this definition">¶</a></dt>
<p>The table class holds a list of EvColumns, each consisting of EvCells so
that the result is a 2D matrix.</p>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvTable.__init__">
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.__init__"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>texts for the table.</strong> (<em>Header</em>) –</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>table</strong> (list of lists or list of <strong>EvColumns</strong>, optional) – This is used to build the table in a quick way. If not
given, the table will start out empty and <strong>add_</strong> methods
need to be used to add rows/columns.</p></li>
<li><p><strong>header</strong> (<em>bool</em><em>, </em><em>optional</em>) –<strong>True</strong>/<strong>False</strong> - turn off the
header texts (<strong>*args</strong>) being treated as a header (such as
not adding extra underlining)</p></li>
<li><p><strong>pad_width</strong> (<em>int</em><em>, </em><em>optional</em>) – How much empty space to pad your cells with
(default is 1)</p></li>
<li><p><strong>border</strong> (<em>str</em><em>, </em><em>optional</em><em>)</em>) – The border style to use. This is one of
- <strong>None</strong> - No border drawing at all.
- “table” - only a border around the whole table.
- “tablecols” - table and column borders. (default)
- “header” - only border under header.
- “cols” - only vertical borders.
- “incols” - vertical borders, no outer edges.
- “rows” - only borders between rows.
- “cells” - border around all cells.</p></li>
<li><p><strong>border_width</strong> (<em>int</em><em>, </em><em>optional</em>) – Width of table borders, if border is active.
Note that widths wider than 1 may give artifacts in the corners. Default is 1.</p></li>
<li><p><strong>corner_char</strong> (<em>str</em><em>, </em><em>optional</em>) – Character to use in corners when border is active.
Default is <strong>+</strong>.</p></li>
<li><p><strong>corner_top_left_char</strong> (<em>str</em><em>, </em><em>optional</em>) – Character used for “nw” corner of table.
Defaults to <strong>corner_char</strong>.</p></li>
<li><p><strong>corner_top_right_char</strong> (<em>str</em><em>, </em><em>optional</em>) – Character used for “ne” corner of table.
Defaults to <strong>corner_char</strong>.</p></li>
<li><p><strong>corner_bottom_left_char</strong> (<em>str</em><em>, </em><em>optional</em>) – Character used for “sw” corner of table.
Defaults to <strong>corner_char</strong>.</p></li>
<li><p><strong>corner_bottom_right_char</strong> (<em>str</em><em>, </em><em>optional</em>) – Character used for “se” corner of table.
Defaults to <strong>corner_char</strong>.</p></li>
<li><p><strong>pretty_corners</strong> (<em>bool</em><em>, </em><em>optional</em>) – Use custom characters to
make the table corners look “rounded”. Uses UTF-8
characters. Defaults to <strong>False</strong> for maximum compatibility with various displays
that may occationally have issues with UTF-8 characters.</p></li>
<li><p><strong>header_line_char</strong> (<em>str</em><em>, </em><em>optional</em>) – Character to use for underlining
the header row (default is ‘~’). Requires <strong>border</strong> to not be <strong>None</strong>.</p></li>
<li><p><strong>width</strong> (<em>int</em><em>, </em><em>optional</em>) – Fixed width of table. If not set,
width is set by the total width of each column. This will
resize individual columns in the vertical direction to fit.</p></li>
<li><p><strong>height</strong> (<em>int</em><em>, </em><em>optional</em>) – Fixed height of table. Defaults to being unset. Width is
still given precedence. If given, table cells will crop text rather
than expand vertically.</p></li>
<li><p><strong>evenwidth</strong> (<em>bool</em><em>, </em><em>optional</em>) – Used with the <strong>width</strong> keyword. Adjusts columns to have as
even width as possible. This often looks best also for mixed-length tables. Default
is <strong>False</strong>.</p></li>
<li><p><strong>maxwidth</strong> (<em>int</em><em>, </em><em>optional</em>) – This will set a maximum width
of the table while allowing it to be smaller. Only if it grows wider than this
size will it be resized by expanding horizontally (or crop <strong>height</strong> is given).
This keyword has no meaning if <strong>width</strong> is set.</p></li>
</ul>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>Exception</strong>– If given erroneous input or width settings for the data.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>Beyond those table-specific keywords, the non-overlapping keywords
of <strong>EvCell.__init__</strong> are also available. These will be passed down
to every cell in the table.</p>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvTable.add_header">
<codeclass="sig-name descname">add_header</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.add_header"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.add_header"title="Permalink to this definition">¶</a></dt>
<dd><p>Add header to table. This is a number of texts to be put at
the top of the table. They will replace an existing header.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>args</strong> (<em>str</em>) – These strings will be used as the header texts.</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>keywords as per EvTable.__init__. Will be applied</strong> (<em>Same</em>) –</p></li>
<li><p><strong>the new header's cells.</strong> (<em>to</em>) –</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvTable.add_column">
<codeclass="sig-name descname">add_column</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.add_column"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.add_column"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a column to table. If there are more rows in new column
than there are rows in the current table, the table will
expand with empty rows in the other columns. If too few, the
new column with get new empty rows. All filling rows are added
to the end.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>args</strong> (<strong>EvColumn</strong> or multiple strings) – Either a single EvColumn instance or
a number of data string arguments to be used to create a new column.</p></li>
<li><p><strong>header</strong> (<em>str</em><em>, </em><em>optional</em>) – The header text for the column</p></li>
<li><p><strong>xpos</strong> (<em>int</em><em>, </em><em>optional</em>) – Index position in table <em>before</em> which
to input new column. If not given, column will be added to the end
of the table. Uses Python indexing (so first column is <strong>xpos=0</strong>)</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>keywords as per Cell.__init__.</strong> (<em>Other</em>) –</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvTable.add_row">
<codeclass="sig-name descname">add_row</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.add_row"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.add_row"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a row to table (not a header). If there are more cells in
the given row than there are cells in the current table the
table will be expanded with empty columns to match. These will
be added to the end of the table. In the same way, adding a
line with too few cells will lead to the last ones getting
padded.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>args</strong> (<em>str</em>) – Any number of string argumnets to use as the
data in the row (one cell per argument).</p></li>
<li><p><strong>ypos</strong> (<em>int</em><em>, </em><em>optional</em>) – Index position in table before which to
input new row. If not given, will be added to the end of the table.
Uses Python indexing (so first row is <strong>ypos=0</strong>)</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>keywords are as per EvCell.__init__.</strong> (<em>Other</em>) –</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvTable.reformat">
<codeclass="sig-name descname">reformat</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.reformat"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.reformat"title="Permalink to this definition">¶</a></dt>
<dd><p>Force a re-shape of the entire table.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>options as per EvTable.__init__.</strong> (<em>Table</em>) –</p>
<codeclass="sig-name descname">reformat_column</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">index</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.reformat_column"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.reformat_column"title="Permalink to this definition">¶</a></dt>
<dd><p>Sends custom options to a specific column in the table.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>index</strong> (<em>int</em>) – Which column to reformat. The column index is
given from 0 to Ncolumns-1.</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>options as per EvCell.__init__.</strong> (<em>Column</em>) –</p>
</dd>
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>Exception</strong>– if an invalid index is found.</p>
</dd>
</dl>
</dd></dl>
<dlclass="py method">
<dtid="evennia.utils.evtable.EvTable.get">
<codeclass="sig-name descname">get</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/utils/evtable.html#EvTable.get"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.utils.evtable.EvTable.get"title="Permalink to this definition">¶</a></dt>
<dd><p>Return lines of table as a list.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>table_lines (list)</em>– The lines of the table, in order.</p>