Table Row Attributes - background color
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 86
- Joined: Wed Feb 09, 2011 10:43 pm
Table Row Attributes - background color
Hello,
I was wondering if there is an attribute that can be set on a row to add a background color to that specific row? The table heading row does that, but I understand that we cannot use more than one tableheading row in a table.
We have long tables. We need the table heading row, but we would also need to add a background color to some of the rows. I was hoping to be able to use something like BGCOLOR="#99CCFF", or something similar.
But apparently it is not supported. oXygen givens me the red line!
Is there a simple way to achieve this result this?
Kind regards
Carole
I was wondering if there is an attribute that can be set on a row to add a background color to that specific row? The table heading row does that, but I understand that we cannot use more than one tableheading row in a table.
We have long tables. We need the table heading row, but we would also need to add a background color to some of the rows. I was hoping to be able to use something like BGCOLOR="#99CCFF", or something similar.
Code: Select all
<strow BGCOLOR="#99CCFF">
<stentry/>
<stentry/>
</strow>.
Is there a simple way to achieve this result this?
Kind regards
Carole
-
- Posts: 9423
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Table Row Attributes - background color
Hi Carole,
You would need some kind of output customization for this.
For example in the DITA content you could set the color as an output class attribute:
If you want this for XHTML-based output you could have a custom CSS which matches the row and sets a background color to it.
If you want this for the PDF output you would need a PDF customization folder which would have an XSLT stylesheet overriding the template which matches a table row.
On the Oxygen XML Blog I explained a couple of weeks ago how to have table rows with alternating colors in the PDF output:
http://blog.oxygenxml.com/2015/06/dita- ... -with.html
Regards,
Radu
You would need some kind of output customization for this.
For example in the DITA content you could set the color as an output class attribute:
Code: Select all
<strow outputclass="#99CCFF">
.....
If you want this for the PDF output you would need a PDF customization folder which would have an XSLT stylesheet overriding the template which matches a table row.
On the Oxygen XML Blog I explained a couple of weeks ago how to have table rows with alternating colors in the PDF output:
http://blog.oxygenxml.com/2015/06/dita- ... -with.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 86
- Joined: Wed Feb 09, 2011 10:43 pm
Re: Table Row Attributes - background color
Hello,
your posts gave me the pointers to achieve what I wanted.
I have a plugin and I don't use a customisation folder.
So in tables-attr.xsl I added under:
This
In tables.xsl I added a condition based on an outputclass value.
then in my table, for each row I whant to color I add:
<row outputclass="color">
This way I can pick the rows I want to color.
Best regards.
Carole
your posts gave me the pointers to achieve what I wanted.
I have a plugin and I don't use a customisation folder.
So in tables-attr.xsl I added under:
Code: Select all
<xsl:attribute-set name="tbody.row">
</xsl:attribute-set>
Code: Select all
<!--new attribute set to color a table row-->
<xsl:attribute-set name="color" use-attribute-sets="tbody.row">
<xsl:attribute name="background-color">#FAFAD2</xsl:attribute>
<xsl:attribute name="border-left-width">15pt</xsl:attribute>
</xsl:attribute-set>
Code: Select all
<!-- New condition to color a table row-->
<xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]">
<xsl:choose>
<xsl:when test="contains(@outputclass, 'color')">
<fo:table-row xsl:use-attribute-sets="color">
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:when>
<xsl:otherwise>
<fo:table-row xsl:use-attribute-sets="tbody.row">
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
then in my table, for each row I whant to color I add:
<row outputclass="color">
This way I can pick the rows I want to color.
Best regards.
Carole
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service