Hi,
I need to set the class of a table in html, but neither of the methods I can find that are supposed to achieve this works for me.
Using the role attribute on a table element in a DocBook xml file has no effect on the html file.
Using the tabstyle attribute on a table element in a DocBook xml file causes the div element surrounding the table in the html file to have the given class. I can't use this because I want to style the table, not the whole div.
I saw https://sourceforge.net/p/docbook/bugs/1151/ but using the latest snapshot hasn't helped.
Here is a minimal DocBook to illustrate the problem (sorry about lack of indents):
<?xml version="1.0" encoding="UTF-8"?>
<article xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en"
xml:id="TestTable">
<sect1>
<table tabstyle="zipclass" role="ziprole" frame='all'><title>My Table</title>
<tgroup cols='1'>
<tbody>
<row>
<entry>Zip</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
</article>
...and here is the relevant snippet of the resulting html:
<div class="zipclass">
<a name="N4000B"></a>
<p class="title">
<b>Table 1. My Table</b>
</p>
<div class="zipclass-contents">
<table summary="My Table" border="1">
<tbody>
<tr>
<td>Zip</td>
</tr>
</tbody>
</table>
</div>
</div>
How do I supply a class attribute for a table in html?
Cheers,
Murray
Well, it seems this should be straightforward, but it is not. The template that generates the
element for HTML output is in table.xsl and starts with:Thanks Bob,
I'm not steeped in HTML+CSS development so it didn't click that I could use the hierarchy to identify those particular tables.
Happy again!
Cheers,
Murray
I checked in a fix for this bug. It's not working in the docbook-xsl-snapshot builds.