class_docstr: Create a nice table representation of data.
  
  Examples
  ========
  
  >>> from sympy import TableForm
  >>> t = TableForm([[5, 7], [4, 2], [10, 3]])
  >>> print(t)
  5  7
  4  2
  10 3
  
  You can use the SymPy's printing system to produce tables in any
  format (ascii, latex, html, ...).
  
  >>> print(t.as_latex())
  \begin{tabular}{l l}
  $5$ & $7$ \\
  $4$ & $2$ \\
  $10$ & $3$ \\
  \end{tabular}
docstr: Returns the string representation of 'self'.
  
  Examples
  ========
  
  >>> from sympy import TableForm
  >>> t = TableForm([[5, 7], [4, 2], [10, 3]])
  >>> s = t.as_str()
docstr_tok: ["Returns","the","string","representation","of","'self","'",".","Examples","========",">",">",">","from","sympy","import","TableForm",">",">",">","t","=","TableForm","(","[","[","5",",","7","]",",","[","4",",","2","]",",","[","10",",","3","]","]",")",">",">",">","s","=","t.as_str","(",")"]
code: def _sympystr(self, p):
      """
      Returns the string representation of 'self'.
  
      Examples
      ========
  
      >>> from sympy import TableForm
      >>> t = TableForm([[5, 7], [4, 2], [10, 3]])
      >>> s = t.as_str()
  
      """
      column_widths = [0] * self._w
      lines = []
      for line in self._lines:
          new_line = []
          for i in range(self._w):
              # Format the item somehow if needed:
              s = str(line[i])
              if self._wipe_zeros and (s == "0"):
                  s = " "
              w = len(s)
              if w > column_widths[i]:
                  column_widths[i] = w
              new_line.append(s)
          lines.append(new_line)
  
      # Check heading:
      if self._headings[0]:
          self._headings[0] = [str(x) for x in self._headings[0]]
          _head_width = max([len(x) for x in self._headings[0]])
  
      if self._headings[1]:
          new_line = []
          for i in range(self._w):
              # Format the item somehow if needed:
              s = str(self._headings[1][i])
              w = len(s)
              if w > column_widths[i]:
                  column_widths[i] = w
              new_line.append(s)
          self._headings[1] = new_line
  
      format_str = []
  
      def _align(align, w):
          return "%%%s%ss" % (("-" if align == "l" else ""), str(w))
  
      format_str = [
          _align(align, w)
          for align, w in zip(self._alignments, column_widths)
      ]
      if self._headings[0]:
          format_str.insert(0, _align(self._head_align, _head_width))
          format_str.insert(1, "|")
      format_str = " ".join(format_str) + "\n"
  
      s = []
      if self._headings[1]:
          d = self._headings[1]
          if self._headings[0]:
              d = [""] + d
          first_line = format_str % tuple(d)
          s.append(first_line)
          s.append("-" * (len(first_line) - 1) + "\n")
      for i, line in enumerate(lines):
          d = [
              l
              if self._alignments[j] != "c"
              else l.center(column_widths[j])
              for j, l in enumerate(line)
          ]
          if self._headings[0]:
              l = self._headings[0][i]
              l = (
                  l
                  if self._head_align != "c"
                  else l.center(_head_width)
              )
              d = [l] + d
          s.append(format_str % tuple(d))
      return "".join(s)[:-1]
  
file_path: sympy/sympy/printing/tableform.py
imports: from sympy.core.containers import Tuple
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.core.sympify import SympifyError
  from types import FunctionType
label_desc: Use image node_id 7 for calling the TableForm obj's underlying member method code with example usage: obj._sympystr(p) and returns: str, unknown