Subject: RE: alignment in tables From: Pieter Rijken <pieter.rijken@xxxxxx> Date: Fri, 21 May 1999 08:43:09 +0200 |
Ken Holman wrote: > > At 99/05/18 16:09 +0200, Pieter Rijken wrote: > >I cannot get the alignment of text in tables right. > >The table I want to format consists of 3 columns. > >Text in the first and third column is left aligned, > >while the contents of the second column should be > >right-aligned. > > > >An example table in SGML looks like: > >... > >I'm trying to display this as: > > > >first row second row third row > >\-------/ \---------------/ \-------/ > >column 1 column 2 column 3 > > > >I try to achieve this with the following DSSSL script > >... > >But this does not work. All columns are left-aligned! I only > seem to get > >the alignment correct when the 'display-alignment' characteristic for > >'make-table' is specified. Unfortunately, this then applies > for all three > >columns! :-( > >Also, the characteristic 'row-cell-alignment' does not do anything!? > > > >What are these alignments for, and why does only the alignment > >specified for the entire table seems to work? > > Because "display-alignment:" is documented to be the alignments of the > *areas* themselves, not the *content* of the areas. An important > distinction that is a common misunderstanding. > > The text in a table belongs inside an area whose area needs > to have the > quadding set to what you desire. Fortunately, quadding is an > inherited > characteristic so you have the opportunity to set it anywhere > before you > use it. > > >BTW, I'm using the TeX backend. > > Same with the RTF backend ... you may find there are no > problems in this > area at all with the TeX backend if you use the example below > (actually, I > would be interested to hear your results, please, since I'm > not using the > TeX backend). > > I hope the example below helps. > > ......... Ken > > > T:\dsssl>type test.sgm > <!DOCTYPE table [ > <!ELEMENT table - O (row+)> > <!ATTLIST table columns NUMBER #REQUIRED> > <!ELEMENT row - O (cell+)> > <!ELEMENT cell - O (#PCDATA)> > ]> > <table columns="3"> > <row> > <cell>first column</cell> > <cell>second column</cell> > <cell>third column</cell> > </row> > </table> > > T:\dsssl>type test.dsl > <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style > Sheet//EN"> > > (root > (make simple-page-sequence > page-width: 8.5in > page-height: 11in > left-margin: .5in > right-margin: .5in > header-margin: .5in > footer-margin: .5in > top-margin: 1in > bottom-margin: 1in > (process-children))) > > (element table > (make table > table-border: #t > cell-after-column-border: #t > (make table-column > quadding: 'start) > (make table-column > quadding: 'end) > (make table-column > quadding: 'start) > (process-children))) > > (element row > (process-children)) > > (element cell > (make table-cell > (make paragraph > (process-children)))) > > ;end of file > T:\dsssl>jade -c p:\jade\jadecurr\catalog -t rtf -o test.rtf test.sgm > > T:\dsssl> > Thanks a lot. It works!! I'm still puzzled about the 'cell-row-alignment:' characteristic of 'table-cell'. The DSSSL standard says in section 12.6.27.6: "cell-row-alignment: is one of the symbols start, end, or center, specifying the alignment of the content of the cell in the row progression direction. The initial value is start." If I understand it correctly, it is about the "content of the cell"!? Anyway, the 'quadding:' characteristic works fine. pieter DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: alignment in tables, G. Ken Holman | Thread | RE: alignment in tables, G. Ken Holman |
Re: jade/jadetex, Adam Di Carlo | Date | Re: 2 questions, Tsyshevsky Vladimir |
Month |