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

I'm creating HTML output via a stored process invoked through the STP Web Interface, code follows.  Since each BY group creates a separate HTML table, and the data in each HTML table determines the widths of its columns, each HTML table is a different size and the columns don't line up ( see image attached ).

 

How do I tell ODS to create either:

   1. consistent table / column widths across all BY groups

   2. one big table where the BY vars are still only output once at the top of each group

 

TIA

 

proc print data = cntl_trigger_results noobs label

                     style (header)             = {background=#D0D0D0 font=(tahoma) font_size=2 font_weight=bold}

                     style (obsheader)    = {background=#D0D0D0 font=(tahoma) font_size=2 font_weight=bold}

                     style (data)         = {background=white font=(tahoma) font_size=1}

                     style (obs)                = {background=white font=(tahoma) font_size=1 foreground=black}

                     ;

                     by trigger_nm descending sys_load_dt descending sys_load_tm;

                     id trigger_nm sys_load_dt sys_load_tm;

                    

                     var trigger_seq_no /style={just=C};;

                     var trigger_seq_rc /style={foreground=colour. just=L};

                     var trigger_seq_type;

                     var    trigger_seq_type_nm trigger_seq_results_txt; * sys_load_dt sys_load_tm;

 


html_output.png
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

 

One of the style elements you can specify for a cell/column is CELLWIDTH if you want to specify specific widths or WIDTH option on proc statement may help but works best with specified formats as that option using format information.

 

Adding  cellwidth= 1.2in to one of the variable style overrides would set the width to 1.2 inches, other units may be used.

 

View solution in original post

4 REPLIES 4
ballardw
Super User

 

One of the style elements you can specify for a cell/column is CELLWIDTH if you want to specify specific widths or WIDTH option on proc statement may help but works best with specified formats as that option using format information.

 

Adding  cellwidth= 1.2in to one of the variable style overrides would set the width to 1.2 inches, other units may be used.

 

HarryD
Fluorite | Level 6

Thank you, that works after a fashion ( e.g. if values are longer than the alloted width columns still move around ).   

 

Seems to me that BY group processing really shouldn't create a separate HTML table ( with column headers each time as well ).  Perhaps I should look at PROC REPORT instead.

 

 

 

 

ballardw
Super User

In the first programming class I took many years ago the instructor said: "You'll spend 90 percent of your time getting the data right and then spend the other 90 percent getting the output to look the way you want."

 

Good luck. At least HTML doesn't worry about Page size, which could be an issue with Proc Report and where to break tables across pages.

HarryD
Fluorite | Level 6

Better image file


html_output.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 4 replies
  • 1338 views
  • 0 likes
  • 2 in conversation