Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
DynareJulia
Dynare.jl
Commits
aed6af98
Commit
aed6af98
authored
Aug 29, 2020
by
MichelJuillard
Browse files
improving table display
parent
6003e42f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dynare_table.jl
View file @
aed6af98
...
...
@@ -2,25 +2,28 @@ using PrettyTables
function
dynare_table
(
data
,
title
,
column_header
,
row_header
,
note
;
fmt
=
"%10.4f"
)
title
=
""
if
length
(
title
)
>
0
pretty_table
([
title
];
noheader
=
true
,
tf
=
borderless
,
pretty_table
([
title
],
noheader
=
true
,
tf
=
borderless
,
highlighters
=
hl_row
(
1
,
crayon
"bold"
))
end
pretty_table
(
data
,
noheader
=
true
;
tf
=
borderless
,
formatter
=
ft_printf
(
fmt
,
1
:
size
(
data
,
1
)
+
1
),
noheader
=
true
,
formatters
=
ft_printf
(
fmt
,
1
:
size
(
data
,
1
)
+
1
),
cell_alignment
=
Dict
(
(
1
,
i
)
=>
:
c
for
i
=
1
:
size
(
data
,
1
)
+
1
),
highlighters
=
(
hl_row
(
1
,
crayon
"bold"
),
hl_col
(
1
,
crayon
"bold"
)),
hlines
=
[
0
,
1
,
l
en
gth
(
row_header
)
],
hlines_format
=
Tuple
(
'─'
for
_
=
1
:
4
),
)
hlines
=
[
:
begin
,
1
,
:
en
d
],
body_
hlines_format
=
Tuple
(
'─'
for
_
=
1
:
4
),
vlines
=
[
1
]
)
if
length
(
note
)
>
0
pretty_table
([
note
]
;
pretty_table
([
note
]
,
noheader
=
true
,
tf
=
borderless
)
end
println
(
" "
)
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment