Two fo:block on the same line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Two fo:block on the same line

Mansour Al Akeel
I need to align two blocks of text left and right on the same line.
I don't mean justify the text. I mean have a space between them.
I think this can be done with tables by using table-cell for the first block of text, and a second one as a separator, then the third one for the
text to be on the right side of the page.
Could this be done without tables ? is there a better way to do it ?

Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Two fo:block on the same line

Tony Graham-4
On Sun, August 7, 2011 7:18 am, Mansour Al Akeel wrote:
> I need to align two blocks of text left and right on the same line.
> I don't mean justify the text. I mean have a space between them.
> I think this can be done with tables by using table-cell for the first
> block
> of text, and a second one as a separator, then the third one for the
> text to be on the right side of the page.
> Could this be done without tables ? is there a better way to do it ?

fo:list-block containing a single fo:list-item with one block in the
fo:list-item-label and the other in the fo:list-item-body.

One fo:block containing a fo:float containing the other fo:block.

Two fo:inline-container with fixed width with a fo:leader between them or
with 'text-align="justify"' on their containing fo:block.

Two absolutely-positioned fo:block-container, e.g. inside another
fo:block-container that establishes their ancestor reference area.

Use a two-column layout where every other top-level fo:block has
'span="all"' and your second fo:block has 'break-before="column"' (and/or
the first one has 'break-after="column"').

If those block are all there is on a special page, use a flow-map with
each block directed to a different region.

Regards,


Tony Graham                                   [hidden email]
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL FO and XSLT consulting, training and programming


Reply | Threaded
Open this post in threaded view
|

Re: Two fo:block on the same line

Mansour Al Akeel
Tony, thank you. But there many things I don't understand here.


fo:list-block containing a single fo:list-item with one block in the
fo:list-item-label and the other in the fo:list-item-body.

One fo:block containing a fo:float containing the other fo:block.

Two fo:inline-container with fixed width with a fo:leader between them or
with 'text-align="justify"' on their containing fo:block.

Where do the fo:inline-container go ?
 
Two absolutely-positioned fo:block-container, e.g. inside another
fo:block-container that establishes their ancestor reference area.


Is this another method ?
 
Use a two-column layout where every other top-level fo:block has
'span="all"' and your second fo:block has 'break-before="column"' (and/or
the first one has 'break-after="column"').


All I needed is a two columns in the first place. One on the left and the other on the right.
But don't know how to get the two column-layout.
Here's what I got from your reply:
<fo:list-block>
            <fo:list-item>
                <fo:list-item-label>
                <fo:block>
                    <fo:float>
                    <fo:block>
                        My Left Block of text
                    </fo:block>
                    <fo:block>
                        With additional Lines
                    </fo:block>
                    </fo:float>
                </fo:block>
                </fo:list-item-label>
                <fo:list-item-body>
                <fo:block>
                    The other Block
                </fo:block>
                </fo:list-item-body>
            </fo:list-item>
            </fo:list-block>

I don't know if I missed something ?

 
If those block are all there is on a special page, use a flow-map with
each block directed to a different region.

Regards,


Tony Graham                                   [hidden email]
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
   XML, XSL FO and XSLT consulting, training and programming



Reply | Threaded
Open this post in threaded view
|

Re: Two fo:block on the same line

Tony Graham-4
On Sun, August 7, 2011 8:14 pm, Mansour Al Akeel wrote:
> Tony, thank you. But there many things I don't understand here.
...
>> Two fo:inline-container with fixed width with a fo:leader between them
>> or
>> with 'text-align="justify"' on their containing fo:block.
>>
>> Where do the fo:inline-container go ?

They would both go inside a fo:block.

>> Two absolutely-positioned fo:block-container, e.g. inside another
>> fo:block-container that establishes their ancestor reference area.
>>
> Is this another method ?

Sorry, each paragraph in my previous email was a separate method for the
same result.

>> Use a two-column layout where every other top-level fo:block has
>> 'span="all"' and your second fo:block has 'break-before="column"'
>> (and/or
>> the first one has 'break-after="column"').
>>
>>
> All I needed is a two columns in the first place. One on the left and the
> other on the right.
> But don't know how to get the two column-layout.
...
> I don't know if I missed something ?

Here's an example of the fo:list-block method:

------------------------------------------------
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:svg="http://www.w3.org/2000/svg">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="normal" page-width="5in"
page-height="5in">
      <fo:region-body margin-right="1in" margin-left="1in"
margin-top="1in" margin-bottom="1in"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="normal" white-space-collapse="true">
    <fo:flow flow-name="xsl-region-body">
      <fo:list-block provisional-distance-between-starts="50% + 5pt"
provisional-label-separation="10pt">
        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>This specification defines the features and syntax
for the Extensible Stylesheet Language (XSL), a language for
expressing stylesheets.</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>An XSL stylesheet specifies the presentation of a
class of XML documents by describing how an instance of the
class is transformed into an XML document that uses the
formatting vocabulary.</fo:block>
          </fo:list-item-body>
        </fo:list-item>
      </fo:list-block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>
----------------------------------------------

Regards,


Tony Graham                                   [hidden email]
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL FO and XSLT consulting, training and programming