'Return string.
This is the default formatter for cells.
Override this to get different formating.
A cell formatter must accept as arguments
a cell (self) and an output format,
one of (\'html\', \'txt\', \'csv\', \'latex\').
It will generally respond to the datatype,
one of (int, \'header\', \'stub\').'

def format(self, width, output_format='txt', **fmt_dict):

    fmt = self._get_fmt(output_format, **fmt_dict)
    data = self.data
    datatype = self.datatype
    data_fmts = fmt.get('data_fmts')
    if (data_fmts is None):
        data_fmt = fmt.get('data_fmt')
        if (data_fmt is None):
            data_fmt = '%s'
        data_fmts = [data_fmt]
    if isinstance(datatype, (int, long)):
        datatype = (datatype % len(data_fmts))
        content = (data_fmts[datatype] % (data,))
    elif (datatype in fmt):
        if ('replacements' in fmt):
            if isinstance(data, str):
                for repl in sorted(fmt['replacements']):
                    data = data.replace(repl, fmt['replacements'][repl])
        dfmt = fmt.get(datatype)
        try:
            content = (dfmt % (data,))
        except TypeError:
            content = dfmt
    else:
        raise ValueError(('Unknown    cell    datatype:    %s' % datatype))
    align = self.alignment(output_format, **fmt)
    return pad(content, width, align)
