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,


Recommended Answers

All 3 Replies

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.

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">
    <td><table width="100%"  border="1" cellpadding="5" cellspacing="0" bordercolor="#00FF00">
        <td>table in left cell </td>
        <td>and another cell </td>
    <td><table width="100%"  border="1" cellpadding="5" cellspacing="0" bordercolor="#0000FF">
        <td>Table in right cell </td>

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

						<fo:block font-size="18pt"	   
							color="	#E8A317"
							linefeed-treatment = "treat-as-space"
							white-space-collapse = "true"
							white-space-treatment = "ignore-if-surrounding-linefeed"
							wrap-option = "wrap"
							<fo:block font-weight="cursive">
						  <xsl:text>Pdfje van Henk! </xsl:text>
                        <fo:block font-weight="bold">
				<xsl:for-each select="item"/>
					<xsl:value-of select="./@caption"/>

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


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,


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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.