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.
I know that I can remove the nocellmerge option but want correctly alternating row colors which it does not seem to allow (see below).
Thank you.
@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.
I know that I can remove the nocellmerge option but want correctly alternating row colors which it does not seem to allow (see below).
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.
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.
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:
Cynthia
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;
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;
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!
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.
Ready to level-up your skills? Choose your own adventure.