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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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