OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

dita-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: auto layout for tables


Hi,

I will appreciate if someone can answer to my questions below.

If I have a simple table like below, without any column specification:

                <simpletable frame="all" id="simpletable_pp4_lrs_x1b">
                    <sthead>
                        <stentry>a</stentry>
                        <stentry>b</stentry>
                        <stentry>c</stentry>
                    </sthead>
                    <strow>
                        <stentry>1</stentry>
                        <stentry>2</stentry>
                        <stentry>3</stentry>
                    </strow>
                    <strow>
<stentry>long content in a table cell long content in a table cell long content in a table cell long content in a table cell </stentry>
                        <stentry>x</stentry>
                        <stentry>y</stentry>
                    </strow>
                    <strow>
                        <stentry>test test test</stentry>
                        <stentry>test</stentry>
                        <stentry>test test</stentry>
                    </strow>
                </simpletable>

How this should be rendered?
With a proportional layout 1/3 width allocated to each column? A dynamic/auto layout which tries to find the optimal width for each column based on the amount of text? The spec does not case and the rendering should be implementation specific?

Similarly for a CALS table, if we do not have any column specification, like in the following sample, what should be the expected layout?

<table frame="all" id="table_jfw_rvs_x1b">
                <title/>
                <tgroup cols="3">
                    <thead>
                        <row>
                            <entry>a</entry>
                            <entry>b</entry>
                            <entry>c</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>1</entry>
                            <entry>2</entry>
                            <entry>3</entry>
                        </row>
                        <row>
<entry>long content in a table cell long content in a table cell long content in a table cell long content in a table cell</entry>
                            <entry>x</entry>
                            <entry>y</entry>
                        </row>
                        <row>
                            <entry>test test test</entry>
                            <entry>test</entry>
                            <entry>test test</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>

Should we get a proportional (1/3 width allocated to each column, similato having 1* specified as the column width for each column), an auto/dynamic layout or the spec does not care and leaves this to each implementation?

Auto layout is a requirement from DITA users but the CALS table spec seems to default missing column info to 1*. Also, DITA-OT has different renderings depending on the target format, PDF is proportional and HTML uses auto layout for rendering tables, for simple tables a proportional layout is always used.

Looking forward to feedback on this - I am interested to understand if DITA enables tables with auto layout and what will be an example of such table.

I attached also a sample topic with different tables and some information on how each is rendered at authoring time in oXygen and in the HTML and PDF output generated by DITA-OT.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_vtl_brs_x1b">
    <title>Tables</title>
    <body>
        <section id="section_ngy_crs_x1b">
            <title>Simple table, proportional (@relcolwidth="1* 1* 1*")</title>
            <p>
                <simpletable frame="all" relcolwidth="1* 1* 1*" id="simpletable_kyw_frs_x1b">
                    <sthead>
                        <stentry>a</stentry>
                        <stentry>b</stentry>
                        <stentry>c</stentry>
                    </sthead>
                    <strow>
                        <stentry>1</stentry>
                        <stentry>2</stentry>
                        <stentry>3</stentry>
                    </strow>
                    <strow>
                        <stentry>long content in a table cell long content in a table cell long
                            content in a table cell long content in a table cell </stentry>
                        <stentry>x</stentry>
                        <stentry>y</stentry>
                    </strow>
                    <strow>
                        <stentry>test test test</stentry>
                        <stentry>test</stentry>
                        <stentry>test test</stentry>
                    </strow>
                </simpletable>
            </p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>Authoring time -
                rendered proportional in oXygen XML Author, same size for each column</p>
            <p>HTML - rendered proportional</p>
            <p>PDF - rendered proportional<?oxy_custom_end?></p>
            <p><b>Code
                fragment</b><codeblock>                &lt;simpletable frame="all" relcolwidth="1* 1* 1*" id="simpletable_kyw_frs_x1b">
                    &lt;sthead>
                        &lt;stentry>a&lt;/stentry>
                        &lt;stentry>b&lt;/stentry>
                        &lt;stentry>c&lt;/stentry>
                    &lt;/sthead>
                    &lt;strow>
                        &lt;stentry>1&lt;/stentry>
                        &lt;stentry>2&lt;/stentry>
                        &lt;stentry>3&lt;/stentry>
                    &lt;/strow>
                    &lt;strow>
                        &lt;stentry>long content in a table cell long content in a table cell long
                            content in a table cell long content in a table cell &lt;/stentry>
                        &lt;stentry>x&lt;/stentry>
                        &lt;stentry>y&lt;/stentry>
                    &lt;/strow>
                    &lt;strow>
                        &lt;stentry>test test test&lt;/stentry>
                        &lt;stentry>test&lt;/stentry>
                        &lt;stentry>test test&lt;/stentry>
                    &lt;/strow>
                &lt;/simpletable>                    </codeblock></p>
        </section>
        <section id="section_psq_drs_x1b">
            <title>Simple table, dynamic (no @relcolwidth specified)</title>
            <p>
                <simpletable frame="all" id="simpletable_pp4_lrs_x1b">
                    <sthead>
                        <stentry>a</stentry>
                        <stentry>b</stentry>
                        <stentry>c</stentry>
                    </sthead>
                    <strow>
                        <stentry>1</stentry>
                        <stentry>2</stentry>
                        <stentry>3</stentry>
                    </strow>
                    <strow>
                        <stentry>long content in a table cell long content in a table cell long
                            content in a table cell long content in a table cell </stentry>
                        <stentry>x</stentry>
                        <stentry>y</stentry>
                    </strow>
                    <strow>
                        <stentry>test test test</stentry>
                        <stentry>test</stentry>
                        <stentry>test test</stentry>
                    </strow>
                </simpletable>
            </p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>Authoring time -
                rendered with auto layout in oXygen XML Author, try to compute an optimal width for
                each column<?oxy_custom_end?></p>
            <?oxy_custom_start type="oxy_content_highlight" color="255,64,0"?>
            <p>HTML - rendered proportional, all culumns with the same size</p>
            <p>PDF - rendered proportional, all culumns with the same size</p><?oxy_custom_end?>
            <p><b>Code
                fragment</b><codeblock>                &lt;simpletable frame="all" id="simpletable_pp4_lrs_x1b">
                    &lt;sthead>
                        &lt;stentry>a&lt;/stentry>
                        &lt;stentry>b&lt;/stentry>
                        &lt;stentry>c&lt;/stentry>
                    &lt;/sthead>
                    &lt;strow>
                        &lt;stentry>1&lt;/stentry>
                        &lt;stentry>2&lt;/stentry>
                        &lt;stentry>3&lt;/stentry>
                    &lt;/strow>
                    &lt;strow>
                        &lt;stentry>long content in a table cell long content in a table cell long
                            content in a table cell long content in a table cell &lt;/stentry>
                        &lt;stentry>x&lt;/stentry>
                        &lt;stentry>y&lt;/stentry>
                    &lt;/strow>
                    &lt;strow>
                        &lt;stentry>test test test&lt;/stentry>
                        &lt;stentry>test&lt;/stentry>
                        &lt;stentry>test test&lt;/stentry>
                    &lt;/strow>
                &lt;/simpletable></codeblock></p>
        </section>
        <section id="section_h43_trs_x1b">
            <title>Simple table, proportional with different values (3*, 1*, 2*)</title>
            <p>
                <simpletable frame="all" relcolwidth="3* 1* 2*" id="simpletable_jxk_vrs_x1b">
                    <sthead>
                        <stentry>a</stentry>
                        <stentry>b</stentry>
                        <stentry>c</stentry>
                    </sthead>
                    <strow>
                        <stentry>1</stentry>
                        <stentry>2</stentry>
                        <stentry>3</stentry>
                    </strow>
                    <strow>
                        <stentry>long content in a table cell long content in a table cell long
                            content in a table cell long content in a table cell </stentry>
                        <stentry>x</stentry>
                        <stentry>y</stentry>
                    </strow>
                    <strow>
                        <stentry>test test test</stentry>
                        <stentry>test</stentry>
                        <stentry>test test</stentry>
                    </strow>
                </simpletable>
            </p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>Authoring time -
                rendered proportional in oXygen XML Author, respecting the size of each column</p>
            <p>HTML - rendered proportional, respecting the size of each column</p>
            <p>PDF - rendered proportional, respecting the size of each column<?oxy_custom_end?></p>
            <p><b>Code
                fragment</b><codeblock>                &lt;simpletable frame="all" relcolwidth="3* 1* 2*" id="simpletable_jxk_vrs_x1b">
                    &lt;sthead>
                        &lt;stentry>a&lt;/stentry>
                        &lt;stentry>b&lt;/stentry>
                        &lt;stentry>c&lt;/stentry>
                    &lt;/sthead>
                    &lt;strow>
                        &lt;stentry>1&lt;/stentry>
                        &lt;stentry>2&lt;/stentry>
                        &lt;stentry>3&lt;/stentry>
                    &lt;/strow>
                    &lt;strow>
                        &lt;stentry>long content in a table cell long content in a table cell long
                            content in a table cell long content in a table cell &lt;/stentry>
                        &lt;stentry>x&lt;/stentry>
                        &lt;stentry>y&lt;/stentry>
                    &lt;/strow>
                    &lt;strow>
                        &lt;stentry>test test test&lt;/stentry>
                        &lt;stentry>test&lt;/stentry>
                        &lt;stentry>test test&lt;/stentry>
                    &lt;/strow>
                &lt;/simpletable></codeblock></p>
        </section>
        <section id="section_e3j_trs_x1b">
            <title>CALS table, proportional</title>
            <table frame="all" id="table_jjh_yts_x1b">
                <title/>
                <tgroup cols="3">
                    <colspec colname="c1" colnum="1" colwidth="1*"/>
                    <colspec colname="c2" colnum="2" colwidth="1*"/>
                    <colspec colname="c3" colnum="3" colwidth="1*"/>
                    <thead>
                        <row>
                            <entry>a</entry>
                            <entry>b</entry>
                            <entry>c</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>1</entry>
                            <entry>2</entry>
                            <entry>3</entry>
                        </row>
                        <row>
                            <entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell</entry>
                            <entry>x</entry>
                            <entry>y</entry>
                        </row>
                        <row>
                            <entry>test test test</entry>
                            <entry>test</entry>
                            <entry>test test test</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>Authoring time -
                rendered proportional in oXygen XML Author, same size for each column</p>
            <p>HTML - rendered proportional</p>
            <p>PDF - rendered proportional<?oxy_custom_end?></p>
            <p><b>Code fragment</b></p>
            <codeblock>            &lt;table frame="all" id="table_jjh_yts_x1b">
                &lt;title/>
                &lt;tgroup cols="3">
                    &lt;colspec colname="c1" colnum="1" colwidth="1*"/>
                    &lt;colspec colname="c2" colnum="2" colwidth="1*"/>
                    &lt;colspec colname="c3" colnum="3" colwidth="1*"/>
                    &lt;thead>
                        &lt;row>
                            &lt;entry>a&lt;/entry>
                            &lt;entry>b&lt;/entry>
                            &lt;entry>c&lt;/entry>
                        &lt;/row>
                    &lt;/thead>
                    &lt;tbody>
                        &lt;row>
                            &lt;entry>1&lt;/entry>
                            &lt;entry>2&lt;/entry>
                            &lt;entry>3&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>long content in a table cell long content in a table cell
                                long content in a table cell long content in a table
                                cell&lt;/entry>
                            &lt;entry>x&lt;/entry>
                            &lt;entry>y&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>test test test&lt;/entry>
                            &lt;entry>test&lt;/entry>
                            &lt;entry>test testÃ?&lt;/entry>
                        &lt;/row>
                    &lt;/tbody>
                &lt;/tgroup>
            &lt;/table></codeblock>
        </section>
        <section id="section_rtj_trs_x1b">
            <title>CALS table, dynamic (no values for @colwidth, but existing colspec
                elements)</title>
            <table frame="all" id="table_jfw_rvs_x1b">
                <title/>
                <tgroup cols="3">
                    <colspec colname="c1" colnum="1"/>
                    <colspec colname="c2" colnum="2"/>
                    <colspec colname="c3" colnum="3"/>
                    <thead>
                        <row>
                            <entry>a</entry>
                            <entry>b</entry>
                            <entry>c</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>1</entry>
                            <entry>2</entry>
                            <entry>3</entry>
                        </row>
                        <row>
                            <entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell</entry>
                            <entry>x</entry>
                            <entry>y</entry>
                        </row>
                        <row>
                            <entry>test test test</entry>
                            <entry>test</entry>
                            <entry>test test</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>
            <p><?oxy_custom_start type="oxy_content_highlight" color="255,64,0"?>Authoring time -
                rendered proportional in oXygen XML Author, same size for each
                column<?oxy_custom_end?></p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>HTML - rendered
                with auto layout<?oxy_custom_end?></p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="255,64,0"?>PDF - rendered
                proportional<?oxy_custom_end?></p>
            <p><b>Code fragment</b></p>
            <codeblock>            &lt;table frame="all" id="table_jfw_rvs_x1b">
                &lt;title/>
                &lt;tgroup cols="3">
                    &lt;colspec colname="c1" colnum="1"/>
                    &lt;colspec colname="c2" colnum="2"/>
                    &lt;colspec colname="c3" colnum="3"/>
                    &lt;thead>
                        &lt;row>
                            &lt;entry>a&lt;/entry>
                            &lt;entry>b&lt;/entry>
                            &lt;entry>c&lt;/entry>
                        &lt;/row>
                    &lt;/thead>
                    &lt;tbody>
                        &lt;row>
                            &lt;entry>1&lt;/entry>
                            &lt;entry>2&lt;/entry>
                            &lt;entry>3&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell&lt;/entry>
                            &lt;entry>x&lt;/entry>
                            &lt;entry>y&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>test test test&lt;/entry>
                            &lt;entry>test&lt;/entry>
                            &lt;entry>test test&lt;/entry>
                        &lt;/row>
                    &lt;/tbody>
                &lt;/tgroup>
            &lt;/table></codeblock>
        </section>
        <section id="section_jjk_trs_x1b">
            <title>CALS table, no colspec elements</title>
            <table frame="all" id="table_rcn_ztt_x1b">
                <title/>
                <tgroup cols="3">
                    <thead>
                        <row>
                            <entry>a</entry>
                            <entry>b</entry>
                            <entry>c</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>1</entry>
                            <entry>2</entry>
                            <entry>3</entry>
                        </row>
                        <row>
                            <entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell</entry>
                            <entry>x</entry>
                            <entry>y</entry>
                        </row>
                        <row>
                            <entry>test test test</entry>
                            <entry>test</entry>
                            <entry>test test</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>Authoring time -
                rendered with auto layout<?oxy_custom_end?></p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>HTML - rendered
                with auto layout<?oxy_custom_end?></p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="255,64,0"?>PDF - rendered
                proportional<?oxy_custom_end?></p>
            <p><b>Code fragment</b></p>
            <codeblock>            &lt;table frame="all" id="table_jfw_rvs_x1b">
                &lt;title/>
                &lt;tgroup cols="3">
                    &lt;thead>
                        &lt;row>
                            &lt;entry>a&lt;/entry>
                            &lt;entry>b&lt;/entry>
                            &lt;entry>c&lt;/entry>
                        &lt;/row>
                    &lt;/thead>
                    &lt;tbody>
                        &lt;row>
                            &lt;entry>1&lt;/entry>
                            &lt;entry>2&lt;/entry>
                            &lt;entry>3&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell&lt;/entry>
                            &lt;entry>x&lt;/entry>
                            &lt;entry>y&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>test test test&lt;/entry>
                            &lt;entry>test&lt;/entry>
                            &lt;entry>test test&lt;/entry>
                        &lt;/row>
                    &lt;/tbody>
                &lt;/tgroup>
            &lt;/table></codeblock>
        </section>
        <section id="section_ow2_2rs_x1b">
            <title>CALS table fixed</title>
            <table frame="all" id="table_ubh_fvt_x1b">
                <title/>
                <tgroup cols="3">
                    <colspec colname="c1" colnum="1" colwidth="108pt"/>
                    <colspec colname="c2" colnum="2" colwidth="75pt"/>
                    <colspec colname="c3" colnum="3" colwidth="26.18pt"/>
                    <thead>
                        <row>
                            <entry>a</entry>
                            <entry>b</entry>
                            <entry>c</entry>
                        </row>
                    </thead>
                    <tbody>
                        <row>
                            <entry>1</entry>
                            <entry>2</entry>
                            <entry>3</entry>
                        </row>
                        <row>
                            <entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell</entry>
                            <entry>x</entry>
                            <entry>y</entry>
                        </row>
                        <row>
                            <entry>test test tet</entry>
                            <entry>test</entry>
                            <entry>test test</entry>
                        </row>
                    </tbody>
                </tgroup>
            </table>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>Authoring time -
                rendered using the fixed layout<?oxy_custom_end?></p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>HTML - rendered
                with fixed layout<?oxy_custom_end?></p>
            <p><?oxy_custom_start type="oxy_content_highlight" color="140,255,140"?>PDF - rendered
                with fixed layout</p><?oxy_custom_end?>
            <p><b>Code fragment</b></p>
            <codeblock>            &lt;table frame="all" id="table_jfw_rvs_x1b">
                &lt;title/>
                &lt;tgroup cols="3">
                    &lt;thead>
                        &lt;row>
                            &lt;entry>a&lt;/entry>
                            &lt;entry>b&lt;/entry>
                            &lt;entry>c&lt;/entry>
                        &lt;/row>
                    &lt;/thead>
                    &lt;tbody>
                        &lt;row>
                            &lt;entry>1&lt;/entry>
                            &lt;entry>2&lt;/entry>
                            &lt;entry>3&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>long content in a table cell long content in a table cell long
                                content in a table cell long content in a table cell&lt;/entry>
                            &lt;entry>x&lt;/entry>
                            &lt;entry>y&lt;/entry>
                        &lt;/row>
                        &lt;row>
                            &lt;entry>test test test&lt;/entry>
                            &lt;entry>test&lt;/entry>
                            &lt;entry>test test&lt;/entry>
                        &lt;/row>
                    &lt;/tbody>
                &lt;/tgroup>
            &lt;/table></codeblock>
        </section>
    </body>
</topic>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]