class_docstr: Provides a table cell.
  A cell can belong to a Row, but does not have to.
class_docstr_tok: ["Provides","a","table","cell",".","A","cell","can","belong","to","a","Row",",","but","does","not","have","to","."]
docstr: 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').
docstr_tok: ["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","'",")","."]
code: def format(self, width, output_format="txt", **fmt_dict):
      """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').
      """
      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:
          # chk allow for deprecated use of data_fmt
          data_fmt = fmt.get("data_fmt")
          if data_fmt is None:
              data_fmt = "%s"
          data_fmts = [data_fmt]
      if isinstance(datatype, int):
          datatype = datatype % len(data_fmts)  # constrain to indexes
          data_fmt = data_fmts[datatype]
          if isinstance(data_fmt, str):
              content = data_fmt % (data,)
          elif callable(data_fmt):
              content = data_fmt(data)
          else:
              raise TypeError("Must be a string or a callable")
          if datatype == 0:
              content = self._latex_escape(content, fmt, output_format)
      elif datatype in fmt:
          data = self._latex_escape(data, fmt, output_format)
  
          dfmt = fmt.get(datatype)
          try:
              content = dfmt % (data,)
          except TypeError:  # dfmt is not a substitution string
              content = dfmt
      else:
          raise ValueError("Unknown cell datatype: %s" % datatype)
      align = self.alignment(output_format, **fmt)
      return pad(content, width, align)
  
imports: from statsmodels.compat.python import lmap, lrange
  from itertools import cycle, zip_longest
  import csv
label_desc: Use image node_id 6 for calling the Cell obj's underlying member method code with example usage: obj.format(width, output_format) and returns: pad