docbook-apps

  • 1.  Aligning table content in xhtml output

    Posted 06-06-2007 23:03
    If I have this in my source:

    <row>
    <entry colname="col1">Text</entry>
    <entry colname="col2">
    <para>Text</para>
    </entry>
    </row>

    I'll get this in my html output:


    Text

    Text




    If I output xhtml, in Firefox, the text in the two cells will not be
    horizontally aligned. Apparently this is a quirks mode thing (if I
    delete the xhtml doctype from the output, the cells do align because I'm
    back in quirks mode). For other reasons, I want to stay out of quirks
    mode.

    What's the right thing to do here? I preprocess the docs before passing
    them to the docbook xsls, but writing code that will figure out whether
    I need to add a <para> around the text sounds complicated (you could
    have <entry>Text<itemizedlist>...and various other combinations. I could
    hack the docbook xsls and always put a

    inside s, but that
    creates ugly xhtml that's hard to style with css.

    It seems like others should be having this problem too :-)

    David



  • 2.  Re: [docbook-apps] Aligning table content in xhtml output

    Posted 06-07-2007 18:01
    El Jueves, 7 de Junio de 2007 01:02, David Cramer (Tech Pubs) escribió:

    >
    > If I output xhtml, in Firefox, the text in the two cells will not be
    > horizontally aligned. Apparently this is a quirks mode thing (if I
    > delete the xhtml doctype from the output, the cells do align because I'm
    > back in quirks mode). For other reasons, I want to stay out of quirks
    > mode.

    Looks like you fixed that on the current snaspshot.

    For that folks not using the snapshot tarball, this CSS snip fix the
    alignament on variablelist-as-table:

    .variablelist td {
    vertical-align: top;
    }

    .variablelist td p {
    margin-top: 0;
    }


    --
    Manuel Canales Esparcia
    Usuario de LFS nº2886: http://www.linuxfromscratch.org
    LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info
    TLDP-ES: http://es.tldp.org



  • 3.  RE: [docbook-apps] Aligning table content in xhtml output

    Posted 06-07-2007 19:55
    Hi Manuel,
    I checked in fixes for variablelist, qandaset, and calloutlist yesterday, but I was having trouble with normal tables. I've been experimenting with css along the lines you suggested. Doing "td p {margin-top: 0;}" can have unwanted consequenses when you nest admonitions in paras, for example, but I'm finding that the following works for the most part:

    td, th {
    vertical-align: top;
    }
    td>p, th>p{
    margin-top: 0;
    }

    But let's say I have docbook that produces this:


    Test

    Test in a para





    In this situation (given that I also have some css to handle vertical alignment: *[valign="middle"]{vertical-align: middle;}), the entry with the para isn't vertically aligned. So if I add this rule:

    td[valign]>p, th[valign]>p{
    margin-top: 1em;
    }

    Things are fine in firefox, but in IE, they're not aligned. I guess it will just be a limitation that you can't use paras in thead/entrys if you want to use valign.

    Also, it still doesn't handle this situation (the lack of a top margin on the resulting

    element removes any space between "Text" and "Another para"), but I can live with that:

    <entry>Text
    <para>Another para</para>
    </entry>

    I'll try this css for a while and see if I find any other unwanted side effects or unhandled cases.

    Thanks,
    David

    >