让docbook支持表格行颜色的渲染
2006-07-07 16:26
211 查看
一般我们都习惯对表格的header设置背景色,这样能够获取比较友好的视觉效果。
但是docbook要设置header颜色,则不能简单通过thead的属性来设置的,这一点让人很不爽。
但是可以通过如下方式来设置:
其中<?dbhtml bgcolor="#EEEEEE" ?>表示在转换为html的时候,表头底色为#EEEEEE。
<?dbfo bgcolor="#EEEEEE" ?>表示在转换为fo文件(为了转换为pdf)的时候,表头底色为#EEEEEE。
但是,在docbook xsl 1.68以前版本,对于 dbfo 是不支持的。那么这时候,就只能够自己手工修改xslt文件的。
大家可以修改 fo目录下的table.xsl文件,对thead的转换,手工增加上颜色,即可。
当然,这样的方式,只能为所有表单设置同样的头颜色了。
如下:
但是docbook要设置header颜色,则不能简单通过thead的属性来设置的,这一点让人很不爽。
但是可以通过如下方式来设置:
<informaltable > <tgroup cols="2"> <colspec align="left" colwidth="200"/> <thead> <row> <?dbhtml bgcolor="#EEEEEE" ?><?dbfo bgcolor="#EEEEEE" ?> <entry align="center" >名称</entry> <entry align="center" >描述</entry> </row> </thead> </tgroup> </informaltable> |
<?dbfo bgcolor="#EEEEEE" ?>表示在转换为fo文件(为了转换为pdf)的时候,表头底色为#EEEEEE。
但是,在docbook xsl 1.68以前版本,对于 dbfo 是不支持的。那么这时候,就只能够自己手工修改xslt文件的。
大家可以修改 fo目录下的table.xsl文件,对thead的转换,手工增加上颜色,即可。
当然,这样的方式,只能为所有表单设置同样的头颜色了。
如下:
<xsl:template match="thead"> <xsl:variable name="tgroup" select="parent::*"/> <fo:table-header background-color="#EEEEEE" font-weight="bold" border-top-width="0.25pt" border-top-style="solid" border-top-color="black" border-left-width="0.25pt" border-left-style="solid" border-left-color="black" border-right-width="0.25pt" border-right-style="solid" border-right-color="black" border-bottom-width="0.25pt" border-bottom-style="solid" border-bottom-color="black" start-indent="0pt" end-indent="0pt"> <xsl:apply-templates select="row[1]"> <xsl:with-param name="spans"> <xsl:call-template name="blank.spans"> <xsl:with-param name="cols" select="../@cols"/> </xsl:call-template> </xsl:with-param> </xsl:apply-templates> </fo:table-header> </xsl:template> |
相关文章推荐
- 让docbook支持颜色的渲染
- adf表格 单双行用不同的颜色渲染
- ogre 渲染时候需要顶点支持颜色混合和alpha渲染状态需要作如下设置
- [原创]对表格行颜色进行渲染(代码示范)
- grid中显示blobImage上传的图片 通过本案例,我们实现blobImage上传的图片在grid表格中的显示。 grid的cellRender方法渲染单元格显示图片,例: 1 2 3 4 5
- jquery 表格的增加删除和修改及设置奇偶行颜色
- [转] AE之分级颜色专题图渲染
- IOS 实现自定义的导航栏背景以及自定义颜色的状态栏(支持7.0以及低版本)
- CE下支持的颜色位数解析
- 0917Android基础自定义View(颜色渲染PorterDuff及Xfermode)
- iOS绘图教程 绘图、变换、颜色管理、脱屏渲染,模板、渐变、
- java用JBarcode组件生成条形码(支持自定义字体及颜色)
- easyUI使用datagrid加载数据后,渲染表格中的控件
- (转)Ogre终于开始改进其对地形渲染的支持
- 项目里出现的问题 01(声明这张图片用原图 别渲染) (随机颜色) (自定义Log) (查找当前ios系统版本是多少)
- 使用百度编辑器ueditor表格无法显示边框以及边框颜色等系列问题解决方案
- android wps表格如何设置边框颜色
- Android background tint颜色渲染
- Win 7下Chrome字体渲染颜色太淡的解决方法
- Android 颜色渲染(九) PorterDuff及Xfermode详解