BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
CLE
Obsidian | Level 7 CLE
Obsidian | Level 7

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;
1 ACCEPTED SOLUTION

Accepted Solutions
RichardDeVen
Barite | Level 11

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

RichardADeVenezia_0-1588923713388.png

 

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

RichardDeVen
Barite | Level 11

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

RichardADeVenezia_0-1588923713388.png

 

CLE
Obsidian | Level 7 CLE
Obsidian | Level 7

Thank you very much for you time! It saved me a lot of struggling to figure that out. 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2866 views
  • 1 like
  • 3 in conversation