Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Seperate styling for first column/last column?

  1. #1
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default Seperate styling for first column/last column?

    Hello,

    I have set a style for border-right to be 1px dashed and a certain color. The problem is, the last column (the far right column) has it and I do not want it. Is there a way to overcome this? I have attached a file...

    Cheers,

    Name:  11-26-2012 4-53-01 PM.jpg
Views: 16
Size:  51.3 KB

    ~D

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Yes, I think you can solve this.

    In your XML package used to display the product, you can check which position you are displaying for each product. When the position is exactly divisible by 4 (the right column), change the CSS class to not show a right border.

    It's difficult to explain without your code but something like this...

    If your regular display was this:

    Code:
    <div class="has_a_border">
      your product goes here
    </div>
    ...and no right border was

    Code:
    <div class="no_right_border">
      your product goes here
    </div>
    Then the XML package code could look like this:

    Code:
    <div>
    <xsl:attribute name="class">
     <xsl:choose>
       <xsl:when test=position() mod 4 = 0>no_right_border</xsl:when>
       <xsl:otherwise>has_a_border</xsl:otherwise>
     </xsl:choose>
    </xsl:attribute>
    Your product goes here
    </div>