'Parameters
data : list of lists or 2d array (not matrix!)
R rows by K columns of table elements
headers : list (or tuple) of str
sequence of K strings, one per header
stubs : list (or tuple) of str
sequence of R strings, one per stub
title : string
title of the table
datatypes : list of int
indexes to `data_fmts`
txt_fmt : dict
text formatting options
ltx_fmt : dict
latex formatting options
csv_fmt : dict
csv formatting options
hmtl_fmt : dict
hmtl formatting options
celltype : class
the cell class for the table (default: Cell)
rowtype : class
the row class for the table (default: Row)
fmt_dict : dict
general formatting options'

def __init__(self, data, headers=None, stubs=None, title='', datatypes=None, csv_fmt=None, txt_fmt=None, ltx_fmt=None, html_fmt=None, celltype=None, rowtype=None, **fmt_dict):

    self.title = title
    self._datatypes = (datatypes or lrange(len(data[0])))
    self._txt_fmt = default_txt_fmt.copy()
    self._latex_fmt = default_latex_fmt.copy()
    self._csv_fmt = default_csv_fmt.copy()
    self._html_fmt = default_html_fmt.copy()
    self._csv_fmt.update(fmt_dict)
    self._txt_fmt.update(fmt_dict)
    self._latex_fmt.update(fmt_dict)
    self._html_fmt.update(fmt_dict)
    self._csv_fmt.update((csv_fmt or dict()))
    self._txt_fmt.update((txt_fmt or dict()))
    self._latex_fmt.update((ltx_fmt or dict()))
    self._html_fmt.update((html_fmt or dict()))
    self.output_formats = dict(txt=self._txt_fmt, csv=self._csv_fmt, html=self._html_fmt, latex=self._latex_fmt)
    self._Cell = (celltype or Cell)
    self._Row = (rowtype or Row)
    rows = self._data2rows(data)
    list.__init__(self, rows)
    self._add_headers_stubs(headers, stubs)
    self._colwidths = dict()
