ODS HTML: I want to build a table look (no spaces between rows) out of multiple proc reports. However, it inserts a space between the output tables. How do I minimize or remove the space between the output tables? The data is different data types so I can't just append into one table. TIA!
proc report data=work.pct_remain_2 nowd missing noheader
style(header) = {font_face="calibri" font_size=10pt bordercolor=black background=orange foreground=white }
style(column)={background=white font_face="calibri" font_size=10pt }
;
columns (Label MIN_ CYC DAYS DATE);
define Label / ' ' style(column)=[cellwidth=1.5in] left;
define MIN_ / ' ' style(column)=[cellwidth=1.5in]center;
define CYC / ' ' style(column)=[cellwidth=1.5in] center ;
define DAYS / ' ' style(column)=[cellwidth=1.5in]center ;
define DATE / ' ' style(column)=[cellwidth=1.5in] center;
run;
proc report data=work.test_2 nowd missing noheader
style(header) = {font_face="calibri" font_size=10pt bordercolor=black background=orange foreground=white }
style(column)={background=white font_face="calibri" font_size=10pt }
;
columns (Label MIN_ CYC DAYS DATE);
define Label / ' ' style(column)=[cellwidth=1.5in] left;
define MIN_ / ' ' style(column)=[cellwidth=1.5in]center;
define CYC / ' ' style(column)=[cellwidth=1.5in] center ;
define DAYS / ' ' style(column)=[cellwidth=1.5in]center ;
define DATE / ' ' style(column)=[cellwidth=1.5in] center;
run;
Hide the bottom border of the top table and top border of the bottom table. Reduce the line-height of the omnipresent table separator <br/> to 0.
data sna;
input A $ B C D E;
datalines;
ABC 1 2 3 4
DEF 5 6 7 8
GHI 9 10 11 12
;
data foo;
input A $ B $ C $ D E;
datalines;
ABC 1 2 3 4
DEF 5 6 7 8
GHI 9 10 11 12
;
ods html file='report.html' style=plateau
headtext = "<style>br { line-height:0 }</style>"
;
title "Tricked! Two tables as one";
proc report data=sna missing noheader
style(report) = { borderbottomwidth=0 }
;
columns (A B C D E);
define A / style(column)=[cellwidth=1.5in] left;
define B / style(column)=[cellwidth=1.5in] center;
define C / style(column)=[cellwidth=1.5in] center ;
define D / style(column)=[cellwidth=1.5in] center ;
define E / style(column)=[cellwidth=1.5in] center;
run;
title;
proc report data=foo missing noheader
style(report) = { bordertopwidth = 0 }
;
columns (A B C D E);
define A / style(column)=[cellwidth=1.5in] left;
define B / style(column)=[cellwidth=1.5in] center;
define C / style(column)=[cellwidth=1.5in] center ;
define D / style(column)=[cellwidth=1.5in] center ;
define E / style(column)=[cellwidth=1.5in] center;
run;
ods _all_ close;
Output
Since your code shows the same variables the question does arise why are the variables of different types?
Perhaps addressing that issue will save a lot of work going forward.
Hide the bottom border of the top table and top border of the bottom table. Reduce the line-height of the omnipresent table separator <br/> to 0.
data sna;
input A $ B C D E;
datalines;
ABC 1 2 3 4
DEF 5 6 7 8
GHI 9 10 11 12
;
data foo;
input A $ B $ C $ D E;
datalines;
ABC 1 2 3 4
DEF 5 6 7 8
GHI 9 10 11 12
;
ods html file='report.html' style=plateau
headtext = "<style>br { line-height:0 }</style>"
;
title "Tricked! Two tables as one";
proc report data=sna missing noheader
style(report) = { borderbottomwidth=0 }
;
columns (A B C D E);
define A / style(column)=[cellwidth=1.5in] left;
define B / style(column)=[cellwidth=1.5in] center;
define C / style(column)=[cellwidth=1.5in] center ;
define D / style(column)=[cellwidth=1.5in] center ;
define E / style(column)=[cellwidth=1.5in] center;
run;
title;
proc report data=foo missing noheader
style(report) = { bordertopwidth = 0 }
;
columns (A B C D E);
define A / style(column)=[cellwidth=1.5in] left;
define B / style(column)=[cellwidth=1.5in] center;
define C / style(column)=[cellwidth=1.5in] center ;
define D / style(column)=[cellwidth=1.5in] center ;
define E / style(column)=[cellwidth=1.5in] center;
run;
ods _all_ close;
Output
Thank you very much for you time! It saved me a lot of struggling to figure that out.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.