BookmarkSubscribeRSS Feed
martyvd
Fluorite | Level 6

I am trying to merge the cells in the GENDER row together because the current HTML output is causing a screen reader to read each cell as hard coded blank space. I would like to have all vertical gridlines in that row removed and have the white background stretched all the way across.

 

Capture.PNG

 

I know that I can remove the nocellmerge option but want correctly alternating row colors which it does not seem to allow (see below).

 

Capture2.PNG

 

Thank you. 

 

6 REPLIES 6
ballardw
Super User

@martyvd wrote:

I am trying to merge the cells in the GENDER row together because the current HTML output is causing a screen reader to read each cell as hard coded blank space. I would like to have all vertical gridlines in that row removed and have the white background stretched all the way across.

 

Capture.PNG

 

I know that I can remove the nocellmerge option but want correctly alternating row colors which it does not seem to allow (see below).

 

Capture2.PNG

 

Thank you. 

 


Since part of your requirement is alternating row colors we need to know how you are addressing row color now. The entire tabulate code would be helpful as well. You might be using other options that need to be addressed.

Reeza
Super User

And if you can't use your actual data, feel free to replicate it with SASHELP.HEART or CLASS if desired. 

There's also many data sets available in the documentation that can be used.

 

Cynthia_sas
Diamond | Level 26

Hi:

  The only real thing you can do is move the word "Gender" up into the BOX area, where you currently have the word Total. Consider this code and output:

row_header_extra_space_tab.png

Cynthia

martyvd
Fluorite | Level 6

Here is the code. 

 

ods tagsets.tableeditor file="&path\&&xst1.&CYR1YY..html"	
      options( 
               frozen_headers="yes"
               frozen_rowheaders="yes"
               banner_color_even="beige"
               banner_color_odd="white"
               header_bgcolor="teal"
			   header_fgcolor="white"
			   rowheader_bgcolor="lightblue"
               gridline_color="gray"
			   header_size="12"  
               rowheader_size="12" 
			   data_size="11" 
              );

PROC TABULATE NOSEPS MISSING FORMAT=comma7. FORMCHAR='              ' data=diswebtbldat;

CLASS STATEFIP disyr sub1;
class age_d sex race ethnic / style={background=white};

tables statefip, all*(n f=5.1*pctn<sub1 all>) 
(sex all)*(pctn<sex all>)*f=5.1 
(age_d all)*(pctn<age_d all>)*f=5.1 
(race all)*(pctn<race all>)*f=5.1 
(ethnic all)*(pctn<ethnic all>)*f=5.1, 
 all sub1 / rts=16 misstext='--' box=_page_ printmiss; 
where statefip IN (&st) and disyr=&CYR1;   

format age_d ageg. sex sex. race race. ethnic ethnic. sub1 sub. services_d dsvc. reason dreason. statefip $state.;

keylabel all='Total' n='No.' pctn='%';

run;  

ods tagsets.tableeditor close;
Cynthia_sas
Diamond | Level 26
Hi:
Unfortunately, since you already have BOX=_PAGE_, you couldn't use the technique shown for my #2 example unless you change the BOX= option.

As I explained, the "double tall" cells where you have GENDER cannot be merged across all the columns.

Cynthia
Reeza
Super User

You could try pre-calculating the numbers and using PROC REPORT to display.

Here's an example. The variable header is a single row, and obviously your data structure may need to change a bit.

 

data test;
infile cards truncover;
input GROUP_VAR $ brand $ Freq Freq1 COUNT;
datalines;      
SUB1 A 2 3 8
SUB1 B 3 5 4
SUB1 C 4 6 2
SUB2 D 5 1 1
SUB2 E 6 5 8
SUB2 F 7 7 9
;
run;

proc tabulate data=test;
class group_var brand / order=data missing;
var freq freq1 count;
table group_var=''*brand='', freq*sum='' freq1*sum='' count*sum=''/misstext='';
run;

proc report nowd data=test;
   col group_var brand freq freq1 count;
   define group_var / group noprint format=$8.;
   define brand/order;
   define freq/ sum;
   define freq1 / sum;
   define count / sum;
  break before group_var  / skip;
    compute before group_var/
      style={cellheight=8pt font_size=12pt just=left};
      line group_var $100.;
  endcomp;
run;

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