[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Help! Tables
Hi,When I process your XML file with the stock DocBook stylesheets, xep.extensions="1", and XEP 4.9, then the table's column specs look like this in the FO file:<fo:table-column column-number="1"/><fo:table-column column-number="2"/>In your FO file, they look like this:<fo:table-column column-number="1" column-width="50%"/><fo:table-column column-number="2" column-width="50%"/>I suspect you have set the stylesheet parameter $tablecolumns.extension=1. Set that back to zero and it should work fine. That extension is not needed with conformant XSL-FO processors.Sent: Friday, October 03, 2008 8:37 AMSubject: Re: [docbook-apps] Help! TablesHi Bob,
Attached is a Zip folder with the input XML file and the output FO file. Thanks!
Lillian
2008/10/1 Bob Stayton <bobs@sagehill.net>
Hi,I meant could you please send me the complete files as attachements? Thanks.Sent: Wednesday, October 01, 2008 4:46 PMSubject: Re: [docbook-apps] Help! TablesXML input
<informaltable frame="topbot">
<tgroup cols='2' colsep="0" rowsep="0">
<colspec colnum='1' colname='col1' align='right'/>
<colspec colnum='2' colname='col2' align='left'/>
<thead rowsep='1'>
<row>
FO Output
<fo:block space-before.minimum="0.5em" space-before.optimum="1em" space-before.maximum="2em" space-after.minimum="0.5em" space-after.optimum="1em" space-after.maximum="2em" id="d0e1484">
−
<fo:table border-before-width.conditionality="retain" border-collapse="collapse" border-left-style="none" border-right-style="none" border-top-style="solid" border-bottom-style="solid" border-top-width="0.5pt" border-bottom-width="0.5pt" border-top-color="black" border-bottom-color="black" width="auto">
<fo:table-column column-number="1" column-width="50%"/>
<fo:table-column column-number="2" column-width="50%"/>
−
<fo:table-header start-indent="0pt" end-indent="0pt">
−
<fo:table-row keep-with-next.within-column="always">
I hope this helps. This seemed like the most important parts. If you need a larger section let me know. Thanks!
Lillian
On Wed, Oct 1, 2008 at 4:25 PM, Bob Stayton <bobs@sagehill.net> wrote:
Hi,Strange. Could you send me your (short) xml input and fo output?Sent: Tuesday, September 30, 2008 11:10 AMSubject: Re: [docbook-apps] Help! TablesHi Bob,
I took a look at the FO output and there is no "table-layout='fixed' on the fo:table element. I also took a look at the fo/table.xsl in the docbook xsl and it looks fine, I haven't done anything to those files. My xep.extentions is set to 1. I have proportional spacing for my header tables. Could that effect my regular tables?
Lillian
On Mon, Sep 29, 2008 at 1:18 PM, Bob Stayton <bobs@sagehill.net> wrote:
Take a peek inside the FO that is generated to see if there is a table-layout="fixed" property on the fo:table element. There should not be, and so XEP should use the default table-layout="auto". If there is a "fixed" value, then something is going on with the stylesheet, because that should only be output if proportional columns are used or if $fop.extensions is non-zero.Sent: Monday, September 29, 2008 12:08 PMSubject: Re: [docbook-apps] Help! TablesRight, I no longer have proportional widths. I do not specify widths at all, but my table (which otherwise looks how I would like it) still spreads the content across the whole length of the page.
length of page
----------------------------------------------------------------------------------------
Some text in a paragraph.
table:
___________________________________________________
type comments
___________________________________________________
0 Text
1 Text
___________________________________________________
More text in a paragraph.
-------------------------------------------------------------------------------------------
I'm sorry for harping on this point, but I've been racking my brain to try to understand why this is happening. I am using the table code you originally sent me. The alignment is great, the frames are great, but the span is problematic.
Lillian
On Mon, Sep 29, 2008 at 11:40 AM, Bob Stayton <bobs@sagehill.net> wrote:
Hi,Perhaps you didn't see this paragraph in my earlier mail?Also, any time you include a proportional column specfication that has "*" means the table will take up the full-width of the available space. If you leave out column width specifications, then the stylesheet will use table-layout="auto" (with XEP and Antenna House which support it) and the table width will try to fit the data.Sent: Monday, September 29, 2008 11:29 AMSubject: Re: [docbook-apps] Help! TablesIt was my customizations! I began the customization work because I do not want the tables to span the full width of the page, but instead, I want the columns to be as wide as the longest line of content. Is this possible with CALS? Thank you so much for your help thus far!
Lillian
On Mon, Sep 29, 2008 at 10:55 AM, Bob Stayton <bobs@sagehill.net> wrote:
First test with the stock stylesheets. That will tell you if the problem is with your customization.Sent: Monday, September 29, 2008 10:51 AMSubject: Re: [docbook-apps] Help! TablesI do use XEP (a trial version right now). I made some customizations and I use my customized stylesheet.
I have commented some items out (because I didn't want to delete them in case they were not the issue). Perhaps my problem lies in the customization?
Here is what it looks like:
<!-- Table -->
<xsl:param name="default.table.frame">all</xsl:param>
<xsl:attribute-set name="table.cell.padding">
<xsl:attribute name="padding-left">5pt</xsl:attribute>
<xsl:attribute name="padding-right">5pt</xsl:attribute>
<xsl:attribute name="padding-top">2pt</xsl:attribute>
<xsl:attribute name="padding-bottom">2pt</xsl:attribute>
</xsl:attribute-set>
<!--
<xsl:param name="html.cellpadding">5%</xsl:param>
-->
<xsl:attribute-set name="table.table.properties">
<xsl:attribute name="border-before-width.conditionality">retain</xsl:attribute>
<xsl:attribute name="border-collapse">collapse</xsl:attribute>
</xsl:attribute-set>
<!--
<xsl:attribute-set name="table.properties">
<xsl:attribute name="align"><xsl:value-of select="$alignment"/></xsl:attribute>
</xsl:attribute-set>
-->
<!-- New Table additions -->
<!--
<xsl:param name="default.table.width">1</xsl:param>
-->
<xsl:param name="table.frame.border.style">solid</xsl:param>
<xsl:param name="table.cell.border.style">solid</xsl:param>
<xsl:param name="tablecolumns.extension" select="1"/>
<xsl:template name="table.cell.properties">
<!-- HTML table -->
<xsl:variable name="border"
select="(ancestor::table |
ancestor::informaltable)[last()]/@border"/>
<xsl:if test="$border != '' and $border != 0">
<xsl:attribute name="border">
<xsl:value-of select="none"/>
<xsl:text> </xsl:text>
<xsl:value-of select="none"/>
<xsl:text> </xsl:text>
<xsl:value-of select="none"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<!-- Table Centering (only works for XEP) -->
<xsl:template name="table.layout">
<xsl:param name="table.content"/>
<fo:table width="100%">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-column column-width="proportional-column-width(10)"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body start-indent="0pt">
<fo:table-row>
<fo:table-cell/>
<fo:table-cell>
<fo:block>
<xsl:copy-of select="$table.content"/>
</fo:block>
<!--
<fo:table>
<fo:table-body start-indent="0pt">
<fo:table-row><fo:table-cell><fo:block>
<xsl:copy-of select="$table.content"/>
</fo:block></fo:table-cell></fo:table-row>
</fo:table-body>
</fo:table>
-->
</fo:table-cell>
<fo:table-cell/>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
<!-- Table Frames -->
<xsl:template name="table.frame">
<xsl:variable name="frame">
<xsl:choose>
<xsl:when test="../@frame">
<xsl:value-of select="../@frame"/>
</xsl:when>
<xsl:when test="$default.table.frame != ''">
<xsl:value-of select="$default.table.frame"/>
</xsl:when>
<xsl:otherwise>all</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$frame='all'">
<xsl:attribute name="border-left-style">none
<!--xsl:value-of select="$table.frame.border.style"/-->
</xsl:attribute>
<xsl:attribute name="border-right-style">none
<!--xsl:value-of select="$table.frame.border.style"/-->
</xsl:attribute>
<xsl:attribute name="border-top-style">
<xsl:value-of select="$table.frame.border.style"/>
</xsl:attribute>
<xsl:attribute name="border-bottom-style">
<xsl:value-of select="$table.frame.border.style"/>
</xsl:attribute>
<xsl:attribute name="border-left-width">
<xsl:value-of select="$table.frame.border.thickness"/>
</xsl:attribute>
<xsl:attribute name="border-right-width">
<xsl:value-of select="$table.frame.border.thickness"/>
</xsl:attribute>
<xsl:attribute name="border-top-width">
<xsl:value-of select="$table.frame.border.thickness"/>
</xsl:attribute>
<xsl:attribute name="border-bottom-width">
<xsl:value-of select="$table.frame.border.thickness"/>
</xsl:attribute>
<xsl:attribute name="border-left-color">
<xsl:value-of select="$table.frame.border.color"/>
</xsl:attribute>
<xsl:attribute name="border-right-color">
<xsl:value-of select="$table.frame.border.color"/>
</xsl:attribute>
<xsl:attribute name="border-top-color">
<xsl:value-of select="$table.frame.border.color"/>
</xsl:attribute>
<xsl:attribute name="border-bottom-color">
<xsl:value-of select="$table.frame.border.color"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
On Mon, Sep 29, 2008 at 10:43 AM, Bob Stayton <bobs@sagehill.net> wrote:
Saxon is fine. You said you were using XEP, right? Are you using your stylesheet customization or are you using the stock DocBook stylesheets?----- Original Message -----From: Lillian SullamTo: Bob StaytonSent: Monday, September 29, 2008 10:22 AMSubject: Re: [docbook-apps] Help! TablesHello,
Thank you for the suggestions. I tried the code you sent me, but the output is still incorrect. For some reason, there are no table lines at all and none of the text followed the "align" specifications.
It looks like
type comments
0 small group of binning settings
1 range of binning settings starting from 1
Could it be my XSLT processor? I'm currently using Saxon 6.5.5
Lillian
On Mon, Sep 29, 2008 at 9:47 AM, Bob Stayton <bobs@sagehill.net> wrote:
Hi,A CALS table can be formatted the way you want. Your CALS example included a rules="rows" attribute, but there is no such attribute on table or informaltable. I think you wanted rowsep="1", and you only wanted it on the header row. The outside borders on a CALS table is handled using the frame attribute.Also, any time you include a proportional column specfication that has "*" means the table will take up the full-width of the available space. If you leave out column width specifications, then the stylesheet will use table-layout="auto" (with XEP and Antenna House which support it) and the table width will try to fit the data.Try this:<informaltable frame="topbot">
<tgroup cols='2' colsep="0" rowsep="0">
<colspec colnum='1' colname='col1' align='right'/>
<colspec colnum='2' colname='col2' align='left'/>
<thead rowsep='1'>
<row>
<entry align='left'>type</entry>
<entry>comments</entry>
</row>
</thead>
<tbody>
<row>
<entry align='right'>0</entry>
<entry>small group of binning settings</entry>
</row>
<row>
<entry>1</entry>
<entry>range of binning settings starting from 1</entry>
</row>
</tbody>
</tgroup>
</informaltable>----- Original Message -----From: Lillian SullamSent: Friday, September 26, 2008 1:49 PMSubject: [docbook-apps] Help! TablesHello,
I'm trying to format my tables (mainly for PDF output appearance, but a general look nonetheless).
Here is what I would like:
______________________
Column1 Column 2_____
1 Some text here
2 Some text here
... ...
______________________
The basic idea is that numbers would be right aligned and text would be left. The size of the table is determined by the longest row.
I've tried making the tables with HTML and CALS, but my results are not satisfactory. With HTML tables I get the size right, but no text alignment. With CALS tables I can control the border appearance, but not the row separation, and the text does not align correctly.
Here is my code:
WITH CALS
<informaltable rules="rows">
<tgroup cols='2'>
<colspec colnum='1' colname='col1' colwidth='1*' align='right'/>
<colspec colnum='2' colname='col2' colwidth='4*'/>
<thead rowsep='1'>
<row>
<entry align='left'>type</entry>
<entry>comments</entry>
</row>
</thead>
<tbody>
<row>
<entry align='right'>0</entry>
<entry>small group of binning settings</entry>
</row>
<row>
<entry>1</entry>
<entry>range of binning settings starting from 1</entry>
</row>
</tbody>
</tgroup>
</informaltable>
WITH HTML
<informaltable>
<colgroup>
<col align="right"/>
<col/>
</colgroup>
<thead>
<tr>
<th align="left">type</th>
<th>comments</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>small group of binning settings</td>
</tr>
<tr>
<td>1</td>
<td>range of binning settings starting from 1</td>
</tr>
</tbody>
</informaltable>
I use docbook-xsl-1.74.0, SAXON, XEP. I've tried to do some tweeking with customizations, but I can't seem to get anything to work. Thanks for any help!
Lillian Sullam
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]