Sas nobot和notop选项是否覆盖模板样式?
我有以下代码Sas nobot和notop选项是否覆盖模板样式?,sas,Sas,我有以下代码 proc template; define style styles.test; parent=styles.analysis; replace output from container / cellpadding=1pt cellspacing=0pt ; end; run; ods html file="C:\users\owner\desktop\class.html" (nobot notop) style=styles.test; proc print data
proc template;
define style styles.test;
parent=styles.analysis;
replace output from container /
cellpadding=1pt
cellspacing=0pt ;
end;
run;
ods html file="C:\users\owner\desktop\class.html" (nobot notop) style=styles.test;
proc print data = sashelp.class;
run;
ods html close;
但它根本没有实现我的测试风格
但是,当我删除(nobot notop)
时,一切正常
我如何实现我的风格并像(nobot notop)
那样去掉顶部和底部 您看到表格外观差异的原因是由于notop
选项。ODS输出的外观(通常)依赖于CSS类。notop
选项将阻止这些类的定义包含在正在创建的.html文件中
通过在启用和不启用该选项的情况下运行该文件,您可以看到如何从文件中排除CSS定义。在记事本中打开文件以查看内容,而不是在web浏览器中
ods html file="C:\example1.html" (nobot notop) style=styles.test;
proc print data = sashelp.class;
run;
ods html close;
ods html file="C:\example2.html" style=styles.test;
proc print data = sashelp.class;
run;
ods html close;
好消息是,您可以使用样式表=
选项将CSS输出到自己的文件中:
ods html file="C:\example2.html" style=styles.test stylesheet="c:\mycss.css";
proc print data = sashelp.class;
run;
ods html close;
这将创建一个文件c:\mycss.css
,其中只包含所需的样式表定义。然后,您可以将此文件上载到Web服务器(或将其复制到与html相同的文件夹),并在html文档标记中添加以下行以包含它:
<head>
<link rel="stylesheet" type="text/css" href="mycss.css">
</head>
为了正确回答这个问题,我们需要更多关于“为什么?”的细节,你需要这样做吗?另外,您对HTML/CSS的工作原理有多熟悉?谢谢您的回复。我需要以html
格式获取表。我正在使用jquery.load
将其包含到我的网站中。问题是SAS提供了cellspacing=3pt
,我不需要这种格式。所以我试着用proc模板
ods html file="C:\example2.html" (nobot notop) style=styles.test stylesheet="c:\mycss2.css";
proc print data = sashelp.class;
run;
ods html close;