I am trying to transform a bit of xml which represents an image gallery into an html table. (it must be done with html and not with css). How do I add the row break
First, assuming that you are using an output format of XML or HTML, I don't think you can place unmatched tags as your are with the What you're doing there is closely related to paging; you might look at paging scripts. Here's an (untested) suggestion from me: Oh, and IIRC, the interior of the loop can be shortened a little bit too: Those curly braces will help save your sanity on long scripts. segment. XSL (in these modes) doesn't just produce string output the way you would with your Javascript. (I could be wrong about this though.)