Hello everyone,

I am a beginning programmer using XSLT.

I work at a company wich has a database witch generates catalogs,

exporting XSL and XML to FOP.(wich converts to PDF). the program runs on apache and is build in delphi.


That being said,

I was wondering if it is possible to put 2 tables next to eachother on the same page,Horizontally. I have not been able to find this yet,Nor did i find any complete examples.

Is there an easy way to do this?

With kind greetings,

Henk.

This is an HTML design problem, not an XSLT problem. What you want is "nested tables". Do some googling to learn how to nest 2 tables within a second table. Here's the first link I found.
http://www.htmlcodetutorial.com/help/archive.php/o_t__t_1472__i-need-tables-side-by-side..html

And example would look something like this, but there's many different ways to do it.

<table width="100%"  border="1" cellpadding="5" cellspacing="0" bordercolor="#FF0000">
  <tr>
    <td><table width="100%"  border="1" cellpadding="5" cellspacing="0" bordercolor="#00FF00">
      <tr>
        <td>table in left cell </td>
        <td>and another cell </td>
      </tr>
    </table></td>
    <td><table width="100%"  border="1" cellpadding="5" cellspacing="0" bordercolor="#0000FF">
      <tr>
        <td>Table in right cell </td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        </tr>
    </table></td>
  </tr>
</table>

Once you know what your HTML node tree needs to look like, creating that in XSLT is just like creating any other node tree structure.

Thank you for your kind reply. problem i would like to be able to do it with XLS:FO.

let me give you an example of my tables.

/fo:table>
		<fo:table table-layout="fixed" width="100%">
		<fo:table-column column-width="50%"/>
      <fo:table-column column-width="90%"/>
			<fo:table-body>
		
				<fo:table-row keep-together.within-page="always">

				   <fo:table-cell>
						<fo:block font-size="18pt"	   
							font-family="serif"
							font-weight="italic" 
							font-style="italic"
							text-align="center"
							color="	#E8A317"
							linefeed-treatment = "treat-as-space"
							white-space-collapse = "true"
							white-space-treatment = "ignore-if-surrounding-linefeed"
							wrap-option = "wrap"
							border-width="4.0mm"
							border-style="groove"
							border-color="red"
							background-color="#E3E4FA"
							padding="8pt">
						  
							  
							<fo:block font-weight="cursive">
						  <xsl:text>Pdfje van Henk! </xsl:text>
          
                        </fo:block>
                         <fo:block>
                        <fo:block font-weight="bold">
                
				<xsl:for-each select="item"/>
					<xsl:value-of select="./@caption"/>

                        </fo:block>
						<fo:block>
                  
						
							<xsl:apply-templates select="item"></xsl:apply-templates>
							 <fo:basic-link 
                external-destination="url('www.google.com')"
               color="blue" text-decoration="underline">
                              klik hier om naar google te gaan
                   </fo:basic-link>
						</fo:block>
                            <fo:block>
                  <fo:external-graphic src="url('http://utopia.ision.nl/users/ptr/pfloyd/interview/boom.jpg')"
                         content-height="50%" content-width="50%"/>
                            </fo:block>       
                         </fo:block>
                       
					  	</fo:block>

						
                     </fo:table-cell>
				</fo:table-row>
			</fo:table-body>
		</fo:table>

I use the keep within same page trick to make sure they line well next under eachother, But i would like to post a table besides it before moving on to the next one without using external langauges.

With kind greetings,

Henk.

Can anyone please give an XSL:FO solution? My FOP engine does not export to PDF if i use html

This article has been dead for over six months. Start a new discussion instead.