How can I design a tree without using (:before, :last-child and :after) because they are not supported in my project (I am using IE7). The problem is that the left border of the list does not stop at the last item.
Example of the problem:
The solution should look like:
Here is a fragment of my jsp code:
<s:if test="testDev == ''">
<s:if test="reponseDTO.testDevItemDTOMap.size > 0">
<div class="misc_pad" style="position:relative">
<p class="p_spacer"><b>Dev</b></p>
<s:iterator value="reponseDTO.testDevItemDTOMap" status="testDevStatus">
<div class="menu_test">
<div>
<a href="expandtestDev_<s:property value="#testDevStatus.index" />" rel="expandtest">
<s:if test="reponseDTO.testDevNiveau2ItemDTOMap.get(key).size > 0"><img id="expandTree" src="<portal-logic:urlFindInTheme file="images/sdin/layout/open_content.gif" />" />
</s:if>
</a>
<a href="<s:property value="value.valeurP" />" rel="testDev" class="menu_test_lien">
<s:property value="value.libelle" /> (<s:property value="value.nombreDocuments" />)</a>
</div>
<s:if test="reponseDTO.testDevNiveau2ItemDTOMap.get(key).size > 0">
<ul id="expandtestDev_<s:property value="#testDevStatus.index" />">
<s:iterator value="reponseDTO.testDevNiveau2ItemDTOMap.get(key)" status="testDevNiveau2Status">
<li>
<div class="menu_test">
<div>
<a href="expandtestDevNiveau2_<s:property value="#testDevStatus.index" />_<s:property value="#testDevNiveau2Status.index" />" rel="expandtest">
<s:if test="reponseDTO.testDevNiveau3ItemDTOMap.get(valeurP).size > 0">
<img id="expandTree" src="<portal-logic:urlFindInTheme file="images/sdin/layout/open_content.gif" />" />
</s:if>
</a>
<a href="<s:property value="valeurP" />" rel="testDev" class="menu_test_lien">
<s:property value="libelle" /> (<s:property value="nombreDocuments" />)
</a>
</div>
<s:if test="reponseDTO.testDevNiveau3ItemDTOMap.get(valeurP).size > 0">
<ul id="expandtestDevNiveau2_<s:property value="#testDevStatus.index" />_<s:property value="#testDevNiveau2Status.index" />">
<s:iterator value="reponseDTO.testDevNiveau3ItemDTOMap.get(valeurP)" status="testDevNiveau3Status">
<li>
<a href="<s:property value="valeurP" />" rel="testDev" class="menu_test_lien"><s:property value="libelle" /> (<s:property value="nombreDocuments" />)</a>
</li>
</s:iterator>
</ul>
</s:if>
</div>
</li>
</s:iterator>
</ul>
</s:if>
</div>
</s:iterator>
</div>
</s:if>
</s:if>
I found this piece of code that looks like what I want:
.test ul {
padding:0;
margin: 0;
margin-left:6px;
list-style:none;
background: #fff;
color:#000;
position:relative;
}
.test ul:before {
content:"";
position:absolute;
top:0;
bottom:0;
left:0;
border-left:1px solid #000;
}
.test li {
margin:0;
padding:0 16px;
line-height:2em;
font-weight:bold;
position:relative;
}
.test li:before {
content:"";
display:block;
width:10px;
height:0;
border-top:1px solid #000;
margin-top:-1px;
position:absolute;
top:1em;
left:0;
}
.test li:last-child:before {
background:white;
height:auto;
top:1em;
bottom:0;
}
<html>
<head>
<link rel="stylesheet" href="test.css">
</head>
<body>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A </a>
</div>
<ul>
<li>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A1 </a>
</div>
<ul>
<li>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A11 </a>
</div>
</div>
</li>
<li>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A12 </a>
</div>
</div>
</li>
</ul>
</div>
</li>
</ul>
</div>
</body>
</html>
Any help will be appreciated.