Web Hosting Forum | Lunarpages
News: November 3, 2008 - Enter Your URL in to WIN the November Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 18, 2008, 11:37:02 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Multiple Columns in XSLT  (Read 246 times)
begeiste
Galactic Royalty
*****
Offline Offline

Posts: 365


WWW
« on: May 07, 2008, 04:17:23 PM »

I am trying to figure out how to produce 3 columns wide and however many rows that are needed until the end of the data is reached. Right now it is producing a single column but I would like the results to span 3 columns wide. Any help? Here's my XSL.
Code:
<?xml version="1.0" encoding="UTF-8"?><!-- DWXMLSource="showdata.xml" --><!DOCTYPE xsl:stylesheet  [
<!ENTITY nbsp   "&#160;">
<!ENTITY copy   "&#169;">
<!ENTITY reg    "&#174;">
<!ENTITY trade  "&#8482;">
<!ENTITY mdash  "&#8212;">
<!ENTITY ldquo  "&#8220;">
<!ENTITY rdquo  "&#8221;">
<!ENTITY pound  "&#163;">
<!ENTITY yen    "&#165;">
<!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Untitled Document</title>
</head>
<body>
<table width="100%" bgcolor="#ffffff">
<tr>
        <!-- Need to repeat this column three times across -->
        <td align="center">
<NewDataSet>
      <Data>
      <xsl:for-each select="NewDataSet/Data">
      <table width="350" border="0" cellpadding="1" cellspacing="0" bgcolor="#BDD154">
              <tr>
                <td valign="top">
                        <table width="100%" border="0" cellpadding="8" cellspacing="4" bgcolor="#FFFFFF">
                                <tr>
                                  <td valign="top">
                                  <img src="{image/@url}" width="180"/>
                                  </td>
                                 </tr>
                        </table>
                  </td>
            </tr>
          </table>
         </xsl:for-each>
</Data>
</NewDataSet>
         </td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Much appreciate your help!
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM