[xep-support] Re: Text in centered table

From: Ron Catterall <ron@catterall.net>
Date: Sun Oct 30 2011 - 11:13:19 PST

Hi Alexander

To center a table title and center the table, both in the page width,
and center the contents of cells, put this in your customization file:

<!-- center table titles in page width -->
<xsl:attribute-set name="formal.title.properties">
<xsl:attribute name="text-align">center</xsl:attribute>
</xsl:attribute-set>

This customization centers the title only. Then set up your table like
the example below (your table title comes in the outer <table>, your
table data comes in the <entrytbl> section), and use the additional
attribute declared above as:
<title text-align="center">title < etc.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE section
[
<!ENTITY % ents SYSTEM "/Users/ron/Documents/_XML/_DocBook/entities.ent">
%ents;
]>
<!-- You will need to adjust these colwidth values to suit your table:
<colspec colname="c1" colnum="1" colwidth="2.0*" colsep="1" rowsep="0"/>
<colspec colname="c2" colnum="2" colwidth="6.0*" colsep="0" rowsep="0"/>
<colspec colname="c3" colnum="3" colwidth="2.0*" colsep="0" rowsep="0"/>
   -->
<section xml:id="Center_table" xmlns="http://docbook.org/ns/docbook"
version="5.0" xml:lang="EN">
<info><title></title></info>
<table frame="none" xml:id="Tab_Delta_5">
<info>
<title text-align="center">Integral Solutions for delta=2 applied to
Individual Constants</title>
</info>
<?dbfo table-width="100.0%" ?>
<tgroup align="center" cols="3">
<colspec colname="c1" colnum="1" colwidth="2.0*" colsep="1" rowsep="0"/>
<colspec colname="c2" colnum="2" colwidth="6.0*" colsep="0" rowsep="0"/>
<colspec colname="c3" colnum="3" colwidth="2.0*" colsep="0" rowsep="0"/>
<spanspec align="center" nameend="c3" namest="c1" spanname="hspan"/>
<tbody valign="middle">
<row valign="middle">
<entry rowsep="0" colsep="0"> </entry>
<entry rowsep="1" colsep="0"> </entry>
<entry rowsep="0" colsep="0"> </entry>
</row>
<row valign="middle">
<entry/>
<entrytbl align="center" cols="7" rowsep="1" colsep="1">
<colspec colname="cl" colnum="1" colwidth="0.8*" colsep="1" rowsep="1"/>
<colspec colname="c2" colnum="2" colwidth="0.8*" colsep="1" rowsep="1"/>
<colspec colname="c3" colnum="3" colwidth="0.8*" colsep="1" rowsep="1"/>
<colspec colname="c4" colnum="4" colwidth="0.8*" colsep="1" rowsep="1"/>
<colspec colname="c5" colnum="5" colwidth="0.8*" colsep="1" rowsep="1"/>
<colspec colname="c6" colnum="6" colwidth="1.0*" colsep="1" rowsep="1"/>
<colspec colname="c7" colnum="7" colwidth="1.0*" colsep="1" rowsep="1"/>
<thead>
<row valign="middle">
<entry align="center">h=601 delta1</entry>
<entry align="center">d=249 delta2</entry>
<entry align="center">f=485 delta3</entry>
<entry align="center">k=893 delta4</entry>
<entry align="center">l=1157 delta5</entry>
<entry align="center">total solutions</entry>
<entry align="center">integral solutions</entry>
</row>
</thead>
<tbody>
<row valign="middle">
<entry align="center">2</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">5</entry>
<entry align="center">3</entry>
</row>
<row valign="middle">
<entry align="center">0</entry>
<entry align="center">2</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">5</entry>
<entry align="center">5</entry>
</row>
<row valign="middle">
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">2</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">5</entry>
<entry align="center">1</entry>
</row>
<row valign="middle">
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">2</entry>
<entry align="center">0</entry>
<entry align="center">5</entry>
<entry align="center">1</entry>
</row>
<row valign="middle">
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">0</entry>
<entry align="center">2</entry>
<entry align="center">5</entry>
<entry align="center">5</entry>
</row>
</tbody>
</entrytbl>
<entry/>
</row>
<row valign="middle">
<entry rowsep="0" colsep="0"/>
<entry rowsep="1" colsep="0"/>
<entry rowsep="0" colsep="0"/>
</row>
</tbody>
</tgroup>
</table>
</section>

On 30-Oct-11 7:29 AM, Alexander Dyuzhev wrote:
> Hi!
> I want to center a table on page.
> First, I create simple table with two column (see Table 1).
> Text place in _one_ line in each cell.
> Second, I need to center this table. I enveloped my table in
> three-column table (for center on page) with use
> proportional-column-width(1) instruction (see Table2).
> But text places in _two_ or _three_ lines in each cell instead in one
> line.
> How to place the text in one line in centered table ?
> Please, see test.fo <http://test.fo> and test.pdf in:
> https://skydrive.live.com/redir.aspx?cid=e323ecc35fbbfab3&resid=E323ECC35FBBFAB3!117
> <https://skydrive.live.com/redir.aspx?cid=e323ecc35fbbfab3&resid=E323ECC35FBBFAB3%21117>
> What do I do wrong ?
>
> --
> Best regards,
> Alexander Dyuzhev
>
>
>
>
> _______________________________________________
> (*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
> (*) By using the Service, you expressly agree to these Terms of Service http://w
> ww.renderx.com/terms-of-service.html

-- 
ron@catterall.net
!DSPAM:87,4eada1de63737820174786!

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Sun Oct 30 11:14:00 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 30 2011 - 11:14:05 PST