BookmarkSubscribeRSS Feed
formerRuser
Fluorite | Level 6

Hello community,

 

I want to produce a table that looks like this (although I made this example in Word):

tableexample.PNG

 

I know this looks bizarre, but we cannot have merged cells for screen readers. Therefore, I need a tiny third column in the first header row (noted with the red arrow, which I'd then make the left border hidden, but I am showing the border here for illustrative purposes) to make it look like there's a merged cell when in fact there is not. For instance, above the leftmost "Header" is another cell with the bottom border hidden to make it look as though there's a vertical merged cell, when there is not.

 

Is it possible to break the continuity of columns like this using RWI? Basically, can there be different columns widths across different rows? When I manually adjust cell widths, subsequent rows keep adjusting to the cell width of the first row, and the table ends up looking more like this example:

 

tableexample2.PNG

 

Here's some example code of what I was trying:

 

data _null_;
set mydata;
if _n_=1 then do;
declare odsout obj();
obj.table_start();
obj.head_start();
obj.row_start();
obj.format_cell(data:"Blank Cell Same Color as Background",
style_attr:"attributes here",
column_span:1,
width:"2.25in");
obj.format_cell(data:"Header",
style_attr:"attributes here",
column_span:1,
width:"1.19in");
obj.format_cell(data:"Blank Cell Same Color as Background",
style_attr:"attributes here",
column_span:1,
width:"0.01in");
obj.row_end();
obj.row_start();
obj.format_cell(data:"Header",
style_attr:"attributes here",
column_span:1,
width:"2.25in");
obj.format_cell(data:"Sub-header",
style_attr:"attributes here",
column_span:1,
width:"0.60in");
obj.format_cell(data:"Sub-header",
style_attr:"attributes here",
column_span:1,
width:"0.60in");
obj.row_end();
obj.head_end();
end;
obj.row_start();
obj.format_cell(data:data1,
style_attr:"attributes here");
obj.format_cell(data: data2,
style_attr:"attributes here");
obj.format_cell(data: data3,
style_attr:"attributes here");
obj.row_end();
run;

 

Thank you!

 

 

1 REPLY 1
Cynthia_sas
Diamond | Level 26

Hi:
I don't think you can do what you want -- but I'm not sure I understand what you want completely. I find your description of what you want to do is confusing.

However, your code throws ERROR messages because of the "attributes" here. Also, you did not provide any data.

If you have issues sharing ALL your code and some test data, you might want to work with Tech Support for help. They can look at ALL your code and your data and answer your question about what you want to do.
Cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1 reply
  • 791 views
  • 0 likes
  • 2 in conversation