Formatting a table with XSLT

585 views
Skip to first unread message

thoerdy f

unread,
Dec 14, 2012, 5:27:37 AM12/14/12
to xs...@googlegroups.com
Hello,
I'm new to xslt and need your help to format a table. Here is the code i already have:
 
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="berichtrepository">
<title><xsl:value-of select="name"/></title>
</xsl:for-each>
<table border="6">
<xsl:for-each select="berichtrepository">
<tr bgcolor="#ffa500">
<th><text>Keywords</text></th>
<th><text>Type</text></th>
<th><text>Category</text></th>
<th><text>Workbook ID</text></th>
<th><text>FS item name</text></th>
<th><text>FS item number</text></th>
</tr>
</xsl:for-each>
<xsl:for-each select="berichtrepository">
<tr>
<td><xsl:value-of select="schlagwoerter"/></td>
<td><xsl:value-of select="typ"/></td>
<td><xsl:value-of select="kategorie"/></td>
<td><xsl:value-of select="workbook_id"/></td>
<td><xsl:value-of select="fs_item_name"/></td>
<td><xsl:value-of select="fs_item_number"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
 
The problem is that the text in the columns each other cut. So i need to know how i can make the lines of the columns visible. Furthermore it would be useful to have some space between the columns.
Thanks for your help.

Christian Wahl

unread,
Dec 18, 2012, 3:35:03 PM12/18/12
to xs...@googlegroups.com
Hi

It sounds more like a styling problem then a XSL problem. Styling table can be done in HTML ans CSS.

For HTML see
http://www.w3schools.com/html/html_tables.asp
- look for cellpadding and cellspacing

For CSS see
http://www.w3schools.com/css/css_table.asp

Hope it helps.

rahul kumar

unread,
Sep 15, 2014, 2:39:52 AM9/15/14
to xs...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages