I'd like all the sectors to be shown in 3 equal length (or as equal as they can be) columns but I don't know where to start. Normally I would just use a ul with a set width and float the li. However as all the main sectors can have different numbers of sub sectors this doesn't work.
It depends how do you want the colums to look. Do you want them to be side by side or one on top of the other?Then I could help you. Also are you doing them all in one table or seprate tables?
If you want them side by side and equal length you'll need to give them a height attribute and also you may have to do a vertical-align to make sure the tops are at an even level
The design has changed slightly so there is now no distinguation between sectors and sub sectors which makes it a bit easier to code. I found this thread and the solution by kmacdonell works for the time being.
The other solution which seems cleaner doesn't seem to work however and I'm curious as to why. Here is my slightly modified version of it. If anyone knows what is wrong, could you explain, thanks.
<!-- selecting setors at level 3 should make sure we only get the top level sectors --> <xsl:variable name="sectorNodes" select="$currentPage/ancestor-or-self::root//Sector[@isDoc and @level <= $level]"/>
<xsl:template match="/">
<xsl:variable name="countRows" select="floor(count($sectorNodes) div 3)" />
Multi column layout including sub items
I want to make a multi column list that lists all items and sub items of a "sector" type. The structure is something like this
sector
-- sector
-- sector
-- sector
sector
sector
-- sector
-- sector
I'd like all the sectors to be shown in 3 equal length (or as equal as they can be) columns but I don't know where to start. Normally I would just use a ul with a set width and float the li. However as all the main sectors can have different numbers of sub sectors this doesn't work.
It depends how do you want the colums to look. Do you want them to be side by side or one on top of the other?Then I could help you. Also are you doing them all in one table or seprate tables?
If you want them side by side and equal length you'll need to give them a height attribute and also you may have to do a vertical-align to make sure the tops are at an even level
The design has changed slightly so there is now no distinguation between sectors and sub sectors which makes it a bit easier to code. I found this thread and the solution by kmacdonell works for the time being.
The other solution which seems cleaner doesn't seem to work however and I'm curious as to why. Here is my slightly modified version of it. If anyone knows what is wrong, could you explain, thanks.
is working on a reply...