Library
Documentation for PrettyTables.jl.
PrettyTables.HTMLDecoration — Type.HTMLDecorationStructure that defines parameters to decorate a table cell.
PrettyTables.HTMLHighlighter — Type.HTMLHighlighterDefines the default highlighter of a table when using the html backend.
Fields
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighter, orfalseotherwise.fd: Function with the signaturef(h,data,i,j)in whichhis the highlighter. This function must return theHTMLDecorationto be applied to the cell that must be highlighted.decoration: TheHTMLDecorationto be applied to the highlighted cell if the defaultfdis used.
Remarks
This structure can be constructed using two helpers:
HTMLHighlighter(f::Function, decoration::HTMLDecoration)
HTMLHighlighter(f::Function, fd::Function)The first will apply a fixed decoration to the highlighted cell specified in decoration whereas the second let the user select the desired decoration by specifying the function fd.
PrettyTables.HTMLTableFormat — Type.HTMLTableFormatFormat that will be used to print the HTML table. All parameters are strings compatible with the corresponding HTML property.
Fields
css: CSS to be injected at the end of the<style>section.table_width: Table width.
Remarks
Besides the usual HTML tags related to the tables (table, td,th,tr, etc.), there are three important classes that can be used to format tables using the variablecss`.
header: This is the class of the header (first line).subheader: This is the class of the sub-headers (all the rest of the lines in the header section).headerLastRow: The last row of the header section has additionally this class.rowNumber: All the cells related to the row number have this class. Thus, the row number header can be styled usingth.rowNumberand the row numbers cells can be styled usingtd.rowNumber.
PrettyTables.Highlighter — Type.HighlighterDefines the highlighter of a table when using the text backend.
Fileds
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighter, orfalseotherwise.crayon: Crayon with the style of a highlighted element.
PrettyTables.Highlighter — Method.Highlighter(f; kwargs...)Construct a Highlighter with activation function f and pass all the keyword arguments kwargs to Crayon.
PrettyTables.LatexHighlighter — Type.LatexHighlighterDefines the default highlighter of a table when using the LaTeX backend.
Fields
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighted, orfalseotherwise.fd: A function with the signaturef(data,i,j,str)::Stringin whichdatais the matrix,(i,j)is the element position in the table, andstris the data converted to string. This function must return a string that will be placed in the cell.
Remarks
This structure can be constructed using two helpers:
LatexHighlighter(f::Function, envs::Union{String,Vector{String}})
LatexHighlighter(f::Function, fd::Function)The first will apply recursively all the LaTeX environments in envs to the highlighted text whereas the second let the user select the desired decoration by specifying the function fd.
Thus, for example:
LatexHighlighter((data,i,j)->true, ["textbf", "small"])will wrap all the cells in the table in the following environment:
\textbf{\small{<Cell text>}}PrettyTables.LatexTableFormat — Type.LatexTableFormatThis structure defines the format of the LaTeX table.
Fields
top_line: Top line of the table.header_line: Line that separate the header from the table body.mid_line: Line printed in the middle of the table.bottom_line: Bottom line of the table.left_vline: Left vertical line of the table.mid_vline: Vertical line in the middle of the table.right_vline: Right vertical line of the table.header_envs: LaTeX environments that will be used in each header cell.subheader_envs: LaTeX environments that will be used in each sub-header cell.
PrettyTables.TextFormat — Type.TextFormatFields
up_right_corner: Character in the up right corner.up_left_corner: Character in the up left corner.bottom_left_corner: Character in the bottom left corner.bottom_right_corner: Character in the bottom right corner.up_intersection: Character in the intersection of lines in the up part.left_intersection: Character in the intersection of lines in the left part.right_intersection: Character in the intersection of lines in the right part.middle_intersection: Character in the intersection of lines in the middle of the table.bottom_intersection: Character in the intersection of the lines in the bottom part.column: Character in a vertical line inside the table.left_border: Character used as the left border.right_border: Character used as the right border.row: Character in a horizontal line inside the table.top_line: Iftrue, then the top table line will be drawn.header_line: Iftrue, then the line between the header and the data will be drawn.bottom_line: Iftrue, then the bottom table line will be drawn.
Pre-defined formats
The following pre-defined formats are available: unicode (default), mysql, compact, markdown, simple, ascii_rounded, and ascii_dots.
PrettyTables.ft_latex_sn — Method.ft_latex_sn(m_digits, [columns])Format the numbers of the elements in the columns columns to a scientific notation using LaTeX. The number is first printed using sprintf1 functions with the g modifier and then converted to the LaTeX format. The number of digits in the mantissa can be selected by the argument m_digits.
If m_digits is a Vector, then columns must be also be a Vector with the same number of elements. If m_digits is a Integer, and columns is not specified (or is empty), then the format will be applied to the entire table. Otherwise, if m_digits is a String and columns is a Vector, then the format will be applied only to the columns in columns.
Remarks
This formatter will be applied only to the cells that are of type Number.
PrettyTables.ft_printf — Method.ft_printf(ftv_str, [columns])Apply the formats ftv_str (see the function sprintf1 of the package Formatting.jl) to the elements in the columns columns.
If ftv_str is a Vector, then columns must be also be a Vector with the same number of elements. If ftv_str is a String, and columns is not specified (or is empty), then the format will be applied to the entire table. Otherwise, if ftv_str is a String and columns is a Vector, then the format will be applied only to the columns in columns.
Remarks
This formatter will be applied only to the cells that are of type Number.
PrettyTables.ft_round — Method.ft_round(digits, [columns])Round the elements in the columns columns to the number of digits in digits.
If digits is a Vector, then columns must be also be a Vector with the same number of elements. If digits is a Number, and columns is not specified (or is empty), then the rounding will be applied to the entire table. Otherwise, if digits is a Number and columns is a Vector, then the elements in the columns columns will be rounded to the number of digits digits.
PrettyTables.hl_cell — Method.hl_cell(i::Number, j::Number, crayon::Crayon)Highlight the cell (i,j) with the crayon crayon.
hl_cell(cells::AbstractVector{NTuple(2,Int)}, crayon::Crayon)Highlights all the cells in cells with the crayon crayon.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_cell — Method.hl_cell(i::Number, j::Number, decoration::HTMLDecoration)Highlight the cell (i,j) with the decoration decoration (see HTMLDecoration).
hl_cell(cells::AbstractVector{NTuple(2,Int)}, decoration::HTMLDecoration)Highlights all the cells in cells with the decoration decoration (see HTMLDecoration).
Remarks
Those functions return a HTMLHighlighter to be used with the HTML backend.
PrettyTables.hl_col — Method.hl_col(i::Number, crayon::Crayon)Highlight the entire column i with the crayon crayon.
hl_col(cols::AbstractVector{Int}, crayon::Crayon)Highlights all the columns in cols with the crayon crayon.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_col — Method.hl_col(i::Number, decoration::HTMLDecoration)Highlight the entire column i with the decoration decoration.
hl_col(cols::AbstractVector{Int}, decoration::HTMLDecoration)Highlights all the columns in cols with the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the HTML backend.
PrettyTables.hl_geq — Method.hl_geq(n::Number, decoration::HTMLDecoration)Highlight all elements that ≥ n using the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the text backend.
PrettyTables.hl_geq — Method.hl_geq(n::Number)Highlight all elements that ≥ n.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_gt — Method.hl_gt(n::Number, decoration::HTMLDecoration)Highlight all elements that > n using the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the text backend.
PrettyTables.hl_gt — Method.hl_gt(n::Number)Highlight all elements that > n.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_leq — Method.hl_leq(n::Number, decoration::HTMLDecoration)Highlight all elements that ≤ n using the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the text backend.
PrettyTables.hl_leq — Method.hl_leq(n::Number)Highlight all elements that ≤ n.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_lt — Method.hl_lt(n::Number, decoration::HTMLDecoration)Highlight all elements that < n using the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the text backend.
PrettyTables.hl_lt — Method.hl_lt(n::Number)Highlight all elements that < n.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_row — Method.hl_row(i::Number, crayon::Crayon)Highlight the entire row i with the crayon crayon.
hl_row(rows::AbstractVector{Int}, crayon::Crayon)Highlights all the rows in rows with the crayon crayon.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.hl_row — Method.hl_row(i::Number, decoration::HTMLDecoration)Highlight the entire row i with the decoration decoration.
hl_row(rows::AbstractVector{Int}, decoration::HTMLDecoration)Highlights all the rows in rows with the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the HTML backend.
PrettyTables.hl_value — Method.hl_value(v::Any, decoration::HTMLDecoration)Highlight all the values that matches data[i,j] == v using the decoration decoration.
Remarks
Those functions return a HTMLHighlighter to be used with the text backend.
PrettyTables.hl_value — Method.hl_value(v::Any)Highlight all the values that matches data[i,j] == v.
Remarks
Those functions return a Highlighter to be used with the text backend.
PrettyTables.include_pt_in_file — Method.include_pt_in_file(filename::AbstractString, mark::AbstractString, args...; kwargs...)Include a table in the file filename using the mark mark.
This function will print a table using the arguments args and keywords kwargs in the function pretty_table (the IO must not be passed to args here). Then, it will search inside the file filename for the following section:
<PrettyTables mark>
...
</PrettyTables>and will replace everything between the marks with the printed table. If the closing tag is in a separate line, then all characters before it will be kept. This is important to add comment tags.
If the user wants to also remove the opening and ending tags, then pass the keyword remove_tags = true.
The keyword tag_append can be used to pass a string that can be used to add a text after the opening tag. This is important for HTML where the comments have openning and closing tags. Thus, if tag_append = " -->", then the following can be used to add a table into HTML files:
<!-- <PrettyTables mark> -->
...
<!-- </PrettyTables> -->By default, this function will copy the original file to filename_backup. If this is not desired, then pass the keyword backup_file = false to the function.
PrettyTables.pretty_table — Method.pretty_table([io::IO | String,] table[, header::AbstractVecOrMat]; kwargs...)Print to io the table table with header header. If io is omitted, then it defaults to stdout. If String is passed in the place of io, then a String with the printed table will be returned by the function.
The header can be a Vector or a Matrix. If it is a Matrix, then each row will be a header line. The first line is called header and the others are called sub-headers . If header is empty or missing, then it will be automatically filled with "Col. i" for the i-th column.
When printing, it will be verified if table complies with Tables.jl API. If it is is compliant, then this interface will be used to print the table. If it is not compliant, then only the following types are supported:
AbstractVector: any vector can be printed. In this case, theheadermust be a vector, where the first element is considered the header and the others are the sub-headers.AbstractMatrix: any matrix can be printed.Dict: anyDictcan be printed. In this case, the special keywordsortkeyscan be used to select whether or not the user wants to print the dictionary with the keys sorted. If it isfalse, then the elements will be printed on the same order returned by the functionskeysandvalues. Notice that this assumes that the keys are sortable, if they are not, then an error will be thrown.
Keywords
alignment: Select the alignment of the columns (see the sectionAlignment).backend: Select which back-end will be used to print the table (see the sectionBackend). Notice that the additional configuration inkwargs...depends on the selected backend. (see the sectionBackend).filters_row: Filters for the rows (see the sectionFilters).filters_col: Filters for the columns (see the sectionFilters).
Notice that all back-ends have the keyword tf to specify the table printing format. Thus, if the keyword backend is not present or if it is nothing, then the back-end will be automatically inferred from the type of the keyword tf. In this case, if tf is also not present, then it just fall-back to the text back-end.
Alignment
The keyword alignment can be a Symbol or a vector of Symbol.
If it is a symbol, we have the following behavior:
:lor:L: the text of all columns will be left-aligned;:cor:C: the text of all columns will be center-aligned;:ror:R: the text of all columns will be right-aligned;- Otherwise it defaults to
:r.
If it is a vector, then it must have the same number of symbols as the number of columns in data. The i-th symbol in the vector specify the alignment of the i-th column using the same symbols as described previously.
Filters
It is possible to specify filters to filter the data that will be printed. There are two types of filters: the row filters, which are specified by the keyword filters_row, and the column filters, which are specified by the keyword filters_col.
The filters are a tuple of functions that must have the following signature:
f(data,i)::Boolin which data is a pointer to the matrix that is being printed and i is the i-th row in the case of the row filters or the i-th column in the case of column filters. If this function returns true for i, then the i-th row (in case of filters_row) or the i-th column (in case of filters_col) will be printed. Otherwise, it will be omitted.
A set of filters can be passed inside of a tuple. Notice that, in this case, all filters for a specific row or column must be return true so that it can be printed, i.e the set of filters has an AND logic.
If the keyword is set to nothing, which is the default, then no filtering will be applied to the data.
The filters do not change the row and column numbering for the others modifiers such as column width specification, formatters, and highlighters. Thus, for example, if only the 4-th row is printed, then it will also be referenced inside the formatters and highlighters as 4 instead of 1.
Pretty table text back-end
This back-end produces text tables. This back-end can be used by selecting back-end = :text.
Keywords
border_crayon: Crayon to print the border.header_crayon: Crayon to print the header.subheaders_crayon: Crayon to print sub-headers.rownum_header_crayon: Crayon for the header of the column with the row numbers.text_crayon: Crayon to print default text.autowrap: Iftrue, then the text will be wrapped on spaces to fit the column. Notice that this function requireslinebreaks = trueand the column must have a fixed size (seecolumns_width).cell_alignment: A dictionary of type(i,j) => athat overrides that alignment of the cell(i,j)toaregardless of the columns alignment selected.amust be a symbol like specified in the sectionAlignment.columns_width: A set of integers specifying the width of each column. If the width is equal or lower than 0, then it will be automatically computed to fit the large cell in the column. If it is a single integer, then this number will be used as the size of all columns. (Default = 0)crop: Select the printing behavior when the data is bigger than the available screen size (seescreen_size). It can be:bothto crop on vertical and horizontal direction,:horizontalto crop only on horizontal direction,:verticalto crop only on vertical direction, or:noneto do not crop the data at all.formatter: See the sectionFormatter.highlighters: An instance ofHighlighteror a tuple with a list of text highlighters (see the sectionText highlighters).hlines: A vector ofIntindicating row numbers in which an additional horizontal line should be drawn after the row. Notice that numbers lower than 1 and equal or higher than the number of rows will be neglected.hlines_format: A tuple of 4 characters specifying the format of the horizontal lines. The characters must be the left intersection, the middle intersection, the right intersection, and the row. If it isnothing, then it will use the same format specified intf. (Default =nothing)linebreaks: Iftrue, then\nwill break the line inside the cells. (Default =false)noheader: Iftrue, then the header will not be printed. Notice that all keywords and parameters related to the header and sub-headers will be ignored. (Default =false)nosubheader: Iftrue, then the sub-header will not be printed, i.e. the header will contain only one line. Notice that this option has no effect ifnoheader = true. (Default =false)same_column_size: Iftrue, then all the columns will have the same size. (Default =false)screen_size: A tuple of two integers that defines the screen size (num. of rows, num. of columns) that is available to print the table. It is used to crop the data depending on the value of the keywordcrop. If it isnothing, then the size will be obtained automatically. Notice that if a dimension is not positive, then it will be treated as unlimited. (Default =nothing)show_row_number: Iftrue, then a new column will be printed showing the row number. (Default =false)tf: Table format used to print the table (seeTextFormat). (Default =unicode)
The keywords header_crayon and subheaders_crayon can be a Crayon or a Vector{Crayon}. In the first case, the Crayon will be applied to all the elements. In the second, each element can have its own crayon, but the length of the vector must be equal to the number of columns in the data.
Crayons
A Crayon is an object that handles a style for text printed on terminals. It is defined in the package Crayons.jl. There are many options available to customize the style, such as foreground color, background color, bold text, etc.
A Crayon can be created in two different ways:
julia> Crayon(foreground = :blue, background = :black, bold = :true)
julia> crayon"blue bg:black bold"For more information, see the package documentation.
Text highlighters
A set of highlighters can be passed as a Tuple to the highlighter keyword. Each highlighter is an instance of the structure Highlighter that contains two fields:
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighted, orfalseotherwise.crayon: Crayon with the style of a highlighted element.
The function f has the following signature:
f(data, i, j)in which data is a reference to the data that is being printed, i and j are the element coordinates that are being tested. If this function returns true, then the highlight style will be applied to the (i,j) element. Otherwise, the default style will be used.
Notice that if multiple highlighters are valid for the element (i,j), then the applied style will be equal to the first match considering the order in the Tuple highlighters.
If only a single highlighter is wanted, then it can be passed directly to the keyword highlighter without being inside a Tuple.
Pretty table HTML backend
This backend produces HTML tables. This backend can be used by selecting backend = :html.
Keywords
cell_alignment: A dictionary of type(i,j) => athat overrides that alignment of the cell(i,j)toaregardless of the columns alignment selected.amust be a symbol like specified in the sectionAlignment.formatter: See the sectionFormatter.highlighters: An instance ofHTMLHighlighteror a tuple with a list of HTML highlighters (see the sectionHTML highlighters).linebreaks: Iftrue, then\nwill be replaced by<br>. (Default =false)noheader: Iftrue, then the header will not be printed. Notice that all keywords and parameters related to the header and sub-headers will be ignored. (Default =false)nosubheader: Iftrue, then the sub-header will not be printed, i.e. the header will contain only one line. Notice that this option has no effect ifnoheader = true. (Default =false)show_row_number: Iftrue, then a new column will be printed showing the row number. (Default =false)standalone: Iftrue, then a complete HTML page will be generated. Otherwise, only the content between the tags<table>and</table>will be printed (with the tags included). (Default =true)tf: An instance of the structureHTMLTableFormatthat defines the general format of the HTML table.
HTML highlighters
A set of highlighters can be passed as a Tuple to the highlighter keyword. Each highlighter is an instance of a structure that is a subtype of AbstractHTMLHighlighter. It also must also contain at least the following two fields to comply with the API:
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighted, orfalseotherwise.fd: Function with the signaturef(h,data,i,j)in whichhis the highlighter. This function must return theHTMLDecorationto be applied to the cell that must be highlighted.
The function f has the following signature:
f(data, i, j)in which data is a reference to the data that is being printed, i and j are the element coordinates that are being tested. If this function returns true, then the highlight style will be applied to the (i,j) element. Otherwise, the default style will be used.
Notice that if multiple highlighters are valid for the element (i,j), then the applied style will be equal to the first match considering the order in the Tuple highlighters.
If the function f returns true, then the function fd(h,data,i,j) will be called and must return an element of type HTMLDecoration that contains the decoration to be applied to the cell.
If only a single highlighter is wanted, then it can be passed directly to the keyword highlighter without being inside a Tuple.
Pretty table LaTeX backend
This backend produces LaTeX tables. This backend can be used by selecting backend = :latex.
Keywords
cell_alignment: A dictionary of type(i,j) => athat overrides that alignment of the cell(i,j)toaregardless of the columns alignment selected.amust be a symbol like specified in the sectionAlignment.formatter: See the sectionFormatter.highlighters: An instance ofLatexHighlighteror a tuple with a list of LaTeX highlighters (see the sectionLaTeX highlighters).hlines: A vector ofIntindicating row numbers in which an additional horizontal line should be drawn after the row. Notice that numbers lower than 1 and equal or higher than the number of rows will be neglected.longtable_footer: The string that will be drawn in the footer of the tables before a page break. This only works iftable_typeis:longtable. If it isnothing, then no footer will be used. (Default =nothing)noheader: Iftrue, then the header will not be printed. Notice that all keywords and parameters related to the header and sub-headers will be ignored. (Default =false)nosubheader: Iftrue, then the sub-header will not be printed, i.e. the header will contain only one line. Notice that this option has no effect ifnoheader = true. (Default =false)row_number_vline: Iftrue, then a vertical line will be draw after the row number column. This only works ifshow_row_numberistrue. (Default =false)show_row_number: Iftrue, then a new column will be printed showing the row number. (Default =false)table_type: Select which LaTeX environment will be used to print the table. Currently supported options are:tabularfortabularor:longtableforlongtable. (Default =:tabular)tf: An instance of the structureLatexTableFormatthat defines the general format of the LaTeX table.
LaTeX highlighters
A set of highlighters can be passed as a Tuple to the highlighter keyword. Each highlighter is an instance of the structure LatexHighlighter. It contains the following two fields:
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighted, orfalseotherwise.fd: A function with the signaturef(data,i,j,str)::Stringin whichdatais the matrix,(i,j)is the element position in the table, andstris the data converted to string. This function must return a string that will be placed in the cell.
The function f has the following signature:
f(data, i, j)in which data is a reference to the data that is being printed, i and j are the element coordinates that are being tested. If this function returns true, then the highlight style will be applied to the (i,j) element. Otherwise, the default style will be used.
Notice that if multiple highlighters are valid for the element (i,j), then the applied style will be equal to the first match considering the order in the Tuple highlighters.
If the function f returns true, then the function fd(data,i,j,str) will be called and must return the LaTeX string that will be placed in the cell.
If only a single highlighter is wanted, then it can be passed directly to the keyword highlighter without being inside a Tuple.
There are two helpers that can be used to create LaTeX highlighters:
LatexHighlighter(f::Function, envs::Union{String,Vector{String}})
LatexHighlighter(f::Function, fd::Function)The first will apply recursively all the LaTeX environments in envs to the highlighted text whereas the second let the user select the desired decoration by specifying the function fd.
Thus, for example:
LatexHighlighter((data,i,j)->true, ["textbf", "small"])will wrap all the cells in the table in the following environment:
\textbf{\small{<Cell text>}}Formatter
The keyword formatter can be used to pass functions to format the values in the columns. It must be a Dict{Number,Function}(). The key indicates the column number in which its elements will be converted by the function in the value of the dictionary. The function must have the following signature:
f(value, i)in which value is the data and i is the row number. It must return the formatted value.
For example, if we want to multiply all values in odd rows of the column 2 by π, then the formatter should look like:
Dict(2 => (v,i)->isodd(i) ? v*π : v)If the key 0 is present, then the corresponding function will be applied to all columns that does not have a specific key.
PrettyTables.@pt — Macro.@pt(expr...)Pretty print tables in expr to stdout using the global configurations selected with the macro @ptconf.
Multiple tables can be printed by passing multiple expressions like:
@pt table1 table2 table3The user can select the table header by passing the expression:
:header = [<Vector with the header>]Notice that the header is valid only for the next printed table. Hence:
@pt :header = header1 table1 :header = header2 table2 table3will print table1 using header1, table2 using header2, and table3 using the default header.
Examples
julia> @ptconf tf = simple
julia> @pt :header = ["Time","Velocity"] [1:1:10 ones(10)] :header = ["Time","Position"] [1:1:10 1:1:10]
======= ===========
Time Velocity
======= ===========
1.0 1.0
2.0 1.0
3.0 1.0
4.0 1.0
5.0 1.0
6.0 1.0
7.0 1.0
8.0 1.0
9.0 1.0
10.0 1.0
======= ===========
======= ===========
Time Position
======= ===========
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
======= ===========
julia> @pt ones(3,3) + I + [1 2 3; 4 5 6; 7 8 9]
========= ======== =========
Col. 1 Col. 2 Col. 3
========= ======== =========
3.0 3.0 4.0
5.0 7.0 7.0
8.0 9.0 11.0
========= ======== =========Remarks
When more than one table is passed to this macro, then multiple calls to pretty_table will occur. Hence, the cropping algorithm will behave exactly the same as printing the tables separately.
PrettyTables.@ptconf — Macro.@ptconf(expr...)Add configurations in expr to be used with the macro @pt.
The expression format must be:
keyword1 = value1 keyword2 = value2 ...in which the keywords can be any other possible keyword that can be used in the function pretty_table.
If a keyword is not supported by the function pretty_table, then no error message is printed when calling @ptconf. However, an error will be thrown when @pt is called.
PrettyTables.@ptconfclean — Macro.@ptconfclean()Clean all global configurations to pretty print tables using the macro @pt.
AbstractHTMLHighlighterAll HTML highlighters must be a subtype of AbstractHTMLHighlighter. They API dictates that they must implement two functions:
f: Function with the signaturef(data,i,j)in which should returntrueif the element(i,j)indatamust be highlighted, orfalseotherwise.fd: Function with the signaturef(h,data,i,j)in whichhis the highlighter. This function must return theHTMLDecorationto be applied to the cell that must be highlighted.
PrettyTables.PrintInfo — Type.PrintInfo{Td,Th}This structure stores the information required so that the backends can print the tables.
PrettyTables.Screen — Type.ScreenStore the information of the screen and the current cursor position. Notice that this is not the real cursor position with respect to the screen, but with respect to the point in which the table is printed.
Fields
size: Screen size.row: Current row.col: Current column.has_color: Indicates if the screen has color support.
PrettyTables._draw_continuation_row — Method._draw_continuation_row(screen, io, tf, text_crayon, border_crayon, num_printed_cols, cols_width, show_row_number, row_number_width)Draw the continuation row when the table has filled the vertical space available. This function prints in each column the character ⋮ centered.
PrettyTables._draw_line! — Method._draw_line!(screen, io, left, intersection, right, row, border_crayon, num_cols, cols_width, show_row_number, row_number_width)Draw a vertical line in io using the information in screen.
PrettyTables._eol — Method._eol(screen)Return true if the cursor is at the end of line or false otherwise.
PrettyTables._nl! — Method._nl!(screen, io)Add a new line into io using the screen information in screen.
PrettyTables._p! — Function._p!(screen, io, crayon, str, final_line_print = false)Print str into io using the Crayon crayon with the screen information in screen. The parameter final_line_print must be set to true if this is the last string that will be printed in the line. This is necessary for the algorithm to select whether or not to include the continuation character.
PrettyTables._str_aligned — Method._str_aligned(data::AbstractString, alignment::Symbol, field_size::Integer)This function returns the string data with alignment alignment in a field with size field_size. alignment can be :l or :L for left alignment, :c or :C for center alignment, or :r or :R for right alignment. It defaults to :r if alignment is any other symbol.
PrettyTables._str_escaped — Method._str_escaped(str::AbstractString)Return the escaped string representation of str.
PrettyTables._str_line_breaks — Function._str_line_breaks(str::AbstractString, autowrap::Bool = false, width::Int = 0)Split the string str into substring, each one meaning one new line. If autowrap is true, then the text will be wrapped so that it fits the column with the width width.