Documentation

Mathlib.Util.FormatTable

Format Table #

This file provides a simple function for formatting a two-dimensional array of Strings into a markdown-compliant table.

inductive Alignment :

Possible alignment modes for each table item: left-aligned, right-aligned and centered.

Instances For
    Equations
      Instances For
        def String.justify (s : String) (a : Alignment) (width : â„•) :

        Align a String s to the left, right, or center within a field of width width.

        Equations
          Instances For
            def formatTable (headers : Array String) (table : Array (Array String)) (alignments : Option (Array Alignment) := none) :

            Render a two-dimensional array of Strings into a markdown-compliant table. headers is a list of column headers, table is a 2D array of cell contents, alignments describes how to align each table column (default: left-aligned).

            Equations
              Instances For