Re: [xep-support] If not use tables like in HTML, how to build this kind of layout

From: Alexander Peshkov <peshkov@renderx.com>
Date: Tue May 24 2005 - 02:11:43 PDT

Hello Laurent,

Well, for the simple cases when you need all "specs" in a column you
can skip using tables and create the following with simple blocks:
  Spec3
  --------------------
  Voltage: 220 Volt
  Capacity: 1000 mAH
  Time: 3 h

your code will looks like:
...
  <xsl:for-each select="//parent">
    <fo:block border-bottom="1pt solid black">
      <xsl:value-of select="@description"/>
    </fo:block>
    <xsl:for-each select="detail">
      <fo:block text-align-last="justify">
        <xsl:value-of select="@description"/>:<fo:leader/><xsl:value-of select="@value"/> <xsl:value-of select="@unit"/>
      </fo:block>
    </xsl:for-each>
  </xsl:for-each>
...
if you want every spec to be fixed width you can wrap it in a
block-container with explicit width specification.

But if you need something more complicated (e.g. several specs in a
row with their width calculated automatically) then tables is a way to go.

Best regards,
Alexander Peshkov mailto:peshkov@renderx.com
RenderX

  
LFma> Hello,

LFma> It has often been said that it is mostly unnecessary to use tables for layout as has been done in HTML. I can agree with this but I can't find an alternative to build something like this:

LFma> ...
LFma> <object_specs>
LFma> <parent description="Spec1">
LFma> <detail unit="mm" description="Length" value="673"/>
LFma> <detail unit="mm" description="Height" value="467"/>
LFma> <detail unit="mm" description="Width" value="723"/>
LFma> </parent>
LFma> <parent description="Spec2">
LFma> <detail unit="kg" description="Weight" value="343"/>
LFma> <detail unit="kg" description="Gross weight" value="1114"/>
LFma> </parent>
LFma> <parent description="Spec3" >
LFma> <detail unit="Volt" description="Voltage" value="220" />
LFma> <detail unit="mAH" description="Capacity" value="1000" />
LFma> <detail unit="h" description="Time" value="3"/>
LFma> </parent>
LFma> </object_specs>
LFma> ...

LFma> It's part of datasheet with pictures and other text blocks.

LFma> This part should formatted like this

LFma> Spec1 Spec2
LFma> -------------------- --------------------
LFma> Length: 673 mm Weight: 343 kg
LFma> Height: 467 mm Gross weight: 1114 kg
LFma> Width: 723 mm

LFma> Spec3
LFma> --------------------
LFma> Voltage: 220 Volt
LFma> Capacity: 1000 mAH
LFma> Time: 3 h

LFma> I tried doing this with <fo:block> and <fo:inline> but I don't see a way to do is. Is this one of the "rare" cases where a table is necessary to create such a layout? If far as I know,
LFma> <fo:block> is always preceded by a newline making it impossible to simulate a table layout...

LFma> Thanks,
LFma> Laurent Frinking

LFma> media access GmbH
LFma> Dornierstr. 17
LFma> 70469 Stuttgart
LFma> Deutschland
LFma> Tel: +49 711 490 30 302
LFma> Fax: +49 711 490 30 22 302
LFma> http://www.media-access.net

LFma> -------------------
LFma> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
LFma> in the body of the message to majordomo@renderx.com from the address
LFma> you are subscribed from.
LFma> (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
Received on Tue May 24 05:53:06 2005

This archive was generated by hypermail 2.1.8 : Tue May 24 2005 - 05:53:07 PDT