[oXygen-user] Tables with width in percents

Mike Starov
Fri Jun 17 10:43:20 CDT 2011


Hello all.

 

I am working on customizing DocBook for our publishing department. I have a difficulty displaying tables in Author mode with "width" set in percents. The table itself is displayed fine with width corresponding to % of the page set in width attribute, but the columns are displayed as much narrower. There is a big chunk of empty space on the right that's not taken up but the columns. 

 

As soon as I change tables width to a set value like 500 the columns expand and take up the whole table space.

 

Example below. Try pasting it and seeing how it gets displayed in oXygen. I know that DocBook schema bundled with Oxygen complains about width attribute but it is supported by HTML tables and there are rules for it in CSS.

 

How can I fix this. I tried playing with CSS but could not find any solution. I looked at the API and there is some interfaces that seem to be able to help with this but It seems pretty complicated. I need some help getting started.

 

<?xml version="1.0" encoding="UTF-8"?>
<sect1 xmlns="http://docbook.org/ns/docbook" version="5.0">
    <title>First section</title>
    <para>
        <table frame="all" width="80%">
            <title>This is table with % width</title>
            <tgroup cols="4">
                <colspec colname="c1" colnum="1" colwidth="1.0*"/>
                <colspec colname="c2" colnum="2" colwidth="1.0*"/>
                <thead>
                    <row>
                        <entry>H</entry>
                        <entry>A</entry>
                    </row>
                </thead>
                <tbody>
                    <row>
                        <entry>1</entry>
                        <entry>2</entry>
                    </row>
                </tbody>
            </tgroup>
        </table>
        <table frame="all" width="500">
            <title>This is table with fixed width</title>
            <tgroup cols="4">
                <colspec colname="c1" colnum="1" colwidth="1.0*"/>
                <colspec colname="c2" colnum="2" colwidth="1.0*"/>
                <thead>
                    <row>
                        <entry>H</entry>
                        <entry>A</entry>
                    </row>
                </thead>
                <tbody>
                    <row>
                        <entry>1</entry>
                        <entry>2</entry>
                    </row>
                </tbody>
            </tgroup>
        </table>
        <table frame="all" width="80%">
            <caption>Nother table HTML</caption>
            <col width="50%"/>
            <col width="50%"/>
            <thead>
                <tr>
                    <th>A</th>
                    <th>B</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td/>
                    <td/>
                </tr>
            </tbody>
        </table>
        <table frame="all" width="500">
            <caption>Nother table HTML fixed width</caption>
            <col width="50%"/>
            <col width="50%"/>
            <thead>
                <tr>
                    <th>A</th>
                    <th>B</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td/>
                    <td/>
                </tr>
            </tbody>
        </table>
    </para>
</sect1>

 

Sincerely,

 

Mike Starovoytov

Software Engineer

CME Resource

1482 Stone Point Drive, Suite 120

Roseville, CA  95661-2839

Telephone: 800-232-4238, extension 193

Fax: (916) 783-6067

Email: 

 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20110617/054dcdf3/attachment.html 


More information about the oXygen-user mailing list