You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Mike Kellstrand <ke...@yahoo.com> on 2004/07/16 16:01:30 UTC

shifting a table to the left

I am trying to figure out how to shift a table side to
side on a page, similar to how start-indent can shift
the text starting point.

I have a page layout with a wide left margin that can
be used for side headings.  When I need a side
heading, I had intended to use a 2 column table, put
the heading in the 1st column, the paragraph text in
the 2nd column, and then shift the whole table to the
left with negative offset to line everything up.

If I use a negative start-indent on the block or
table, the text starting point moves to the left, but
since the table stays put, the text right margin
doesn't move over with it, it effectively stays with
the table, which hasn't moved.  end-indent has no
effect.

Is there any way to cause the whole table to shift to
the left, so that the table-cells will enforce the
text margins?

Thanks,
Mike Kellstrand



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: shifting a table to the left

Posted by Mike Kellstrand <ke...@yahoo.com>.
OK, here is my solution.  I'm doing more interesting
things in the actual table cell content, but you guys
won't care about that, so I've altered it to just put
text in each cell.

Mike
====================================================
  <!--
=========================================================================
-->
  <!--                                                
                          -->
  <!-- processCrossAlignHeader                        
                          -->
  <!--                                                
                          -->
  <!-- On a page layout with a wide left margin for
this purpose, this template  -->
  <!-- will put a heading to the left of the main
content flow, aligned with the -->
  <!-- first line of the content.                     
                          -->
  <!--                                                
                          -->
  <!-- This is done by creating a 3 column table to
hold the header and content, -->
  <!-- and then "shifting" it to the left by the right
amount.  We need 3        -->
  <!-- columns so we can have a middle "gutter"
column.                          -->
  <!--                                                
                          -->
  <!-- I was unable to find a way to shift the table
itself, so I used a         -->
  <!-- combination of start-indent and end-indent
attributes on the table and    -->
  <!-- blocks that create a set of virtual margins to
constrain the text flows   -->
  <!-- to where the table-cells would be, if we could
simply shift the whole     -->
  <!-- table over.                                    
                          -->
  <!--                                                
                          -->
  <!-- @param headerNode the header node to cross
align in the wide left margin  -->
  <!-- @param actNode    the activity node to put in
the normal flow area        -->
  <!--                                                
                          -->
  <!--
=========================================================================
-->
  <xsl:template name='processCrossAlignHeader'>
    <xsl:param name='headerNode' />
    <xsl:param name='actNode' />

    <!--  The widths of the 3 comumns, per the page
master  -->
    <xsl:variable name="headerColWidth">(8pc +
6.75pt)</xsl:variable>
    <xsl:variable name="gutterColWidth">(1pc +
3pt)</xsl:variable>
    <xsl:variable name="bodyColWidth">(29pc +
5.25pt)</xsl:variable>

    <!--  Shift all text to the left  -->
    <fo:block start-indent="-({$headerColWidth} +
{$gutterColWidth})">

      <fo:table table-layout="fixed">

        <!--  This column will hold the cross aligned
header  -->
        <fo:table-column
column-width="{$headerColWidth}"/>
        <!--  This column is just a gutter between the
other 2 columns  -->
        <fo:table-column
column-width="{$gutterColWidth}"/>
        <!--  This column will hold the paragraph
content and will line up with the normal page flow 
-->
        <!--  Note that its width is reduced by the
shift amount to put the right margin at the correct
place  -->
        <fo:table-column column-width="{$bodyColWidth}
- ({$headerColWidth} + {$gutterColWidth})"/>

        <fo:table-body>

            <fo:table-row>
            
              <!--  display the heading text  -->
              <fo:table-cell>
              
                <!--  set the correct right margin for
the header  -->
                <fo:block
end-indent="({$headerColWidth} + {$gutterColWidth})">
                  <xsl:value-of select="$headerNode"/>
                </fo:block>

              </fo:table-cell>

              <!--  dummy gutter  -->
              <fo:table-cell>
                <fo:block></fo:block>
              </fo:table-cell>
            
              <!--  display the paragraph content text
 -->
              <fo:table-cell>
                <fo:block>
                  <xsl:value-of select="$actNode"/>
                </fo:block>
              </fo:table-cell>
            
            </fo:table-row>
          
        </fo:table-body>

      </fo:table>

    </fo:block>


  </xsl:template>


====================================================

--- Clay Leeds <cl...@medata.com> wrote:
> Mike,
> 
> On Jul 16, 2004, at 7:17 AM, Mike Kellstrand wrote:
> > OK, although I have not been able to get the table
> > itself to shift to the left, I have been able to
> find
> > a combination of start-indent and end-indent
> attribs
> > at the right spots to visually do exactly what I
> need.
> >
> > If anyone can shift the table itself, then that
> would
> > be the nicer solution.
> >
> > Thanks,  Mike
> 
> Unfortunately, I don't have an idea for how to shift
> the table (other 
> than having an extra column on the left that is not
> in use *except* 
> when you want to 'shift' the table over).
> 
> However, it might be nice to have your solution in
> the archives for 
> others to use. :-)
> 
> Web Maestro Clay
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: shifting a table to the left

Posted by Clay Leeds <cl...@medata.com>.
Mike,

On Jul 16, 2004, at 7:17 AM, Mike Kellstrand wrote:
> OK, although I have not been able to get the table
> itself to shift to the left, I have been able to find
> a combination of start-indent and end-indent attribs
> at the right spots to visually do exactly what I need.
>
> If anyone can shift the table itself, then that would
> be the nicer solution.
>
> Thanks,  Mike

Unfortunately, I don't have an idea for how to shift the table (other 
than having an extra column on the left that is not in use *except* 
when you want to 'shift' the table over).

However, it might be nice to have your solution in the archives for 
others to use. :-)

Web Maestro Clay


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: shifting a table to the left

Posted by Mike Kellstrand <ke...@yahoo.com>.
OK, although I have not been able to get the table
itself to shift to the left, I have been able to find
a combination of start-indent and end-indent attribs
at the right spots to visually do exactly what I need.

If anyone can shift the table itself, then that would
be the nicer solution.

Thanks,  Mike

--- Mike Kellstrand <ke...@yahoo.com> wrote:
> I am trying to figure out how to shift a table side
> to
> side on a page, similar to how start-indent can
> shift
> the text starting point.
> 
> I have a page layout with a wide left margin that
> can
> be used for side headings.  When I need a side
> heading, I had intended to use a 2 column table, put
> the heading in the 1st column, the paragraph text in
> the 2nd column, and then shift the whole table to
> the
> left with negative offset to line everything up.
> 
> If I use a negative start-indent on the block or
> table, the text starting point moves to the left,
> but
> since the table stays put, the text right margin
> doesn't move over with it, it effectively stays with
> the table, which hasn't moved.  end-indent has no
> effect.
> 
> Is there any way to cause the whole table to shift
> to
> the left, so that the table-cells will enforce the
> text margins?
> 
> Thanks,
> Mike Kellstrand


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org