Hi!
I have just requested a new version of PrettyTables.jl to be tagged. The changes are:
- The format of the horizontal line in the table, which are drawn using the option
hlines
, can now be selected using the keywordhlines_format
. - The alignment of a single cell can now be changed regardless of the column alignment. This can be achieve by the keyword
cell_alignment
. - The line between the header and the data can now be hide using the variable
header_line
of the structurePrettyTableFormat
. - New predefined highlighters:
hl_cell
,hl_col
,hl_row
, which can be used to apply highlights to single cells or to entire columns or rows, respectively. - The formatter
ft_printf
is now only applied to cells that are of typeNumber
. (Issue [#19][gh-issue-19]) - The formatter
ft_printf
can now receive one integer if the user wants to format only a single column. - End of support of Julia 1.1. The supported versions are 1.0 and 1.2.
I needed the additional options and configuration possibilities to be able to print text reports for a project I am working on related to SatelliteToolbox.jl. Thus, we now can do the following:
julia> data = ["Torques" "" "" "";
"Atmospheric drag" "."^10 10 "10⁻⁵ Nm";
"Gravity gradient" "."^10 3 "10⁻⁵ Nm";
"Solar radiation pressure" "."^10 0.1 "10⁻⁵ Nm";
"Total" "."^10 13.1 "10⁻⁵ Nm";
"" "" "" ""
"Angular momentum" "" "" "";
"Atmospheric drag" "."^10 6.5 "Nms";
"Gravity gradient" "."^10 3.0 "Nms";
"Solar radiation pressure" "."^10 1.0 "Nms";
"Total" "."^10 10.5 "Nms"]
julia> pretty_table(data, borderless;
noheader = true,
cell_alignment = Dict( (1,1) => :l, (7,1) => :l ),
formatter = ft_printf("%10.1f", 2),
highlighters = (hl_cell( [(1,1);(7,1)], crayon"bold"),
hl_col(2, crayon"dark_gray"),
hl_row([5,11], crayon"bold yellow")),
hlines = [1,7],
hlines_format = Tuple('─' for _ = 1:4) )
to create this text report: