Как можно сделать боковые линии для каждой таблицы tr , как древовидная структура?
Кроме того, вложенные таблицы будут входить в некоторые из tr .
Пример кода Fiddle Link :
#smsTree {
margin-top: 30px;
}
#smsTree tr:not(:last-child) {
border-left: 1px solid #ccc;
}
#smsTree tr:not(:last-child) + #smsTree tr:not(:first-child) {
content: "";
position: absolute;
left: 35px;
z-index: 100;
width: 20px;
height: 100px;
border-bottom: 1px solid #ccc;
}
#smsTree tr:first-child:before {
border-bottom: none;
}
#smsTree tr:before {
content: "";
position: absolute;
left: 20px;
z-index: 100;
width: 20px;
height: 10%;
border-bottom: 1px solid #ccc;
}
#smsTree tr:last-child:before {
border-left: 1px solid #ccc;
}
<div id="smsTree">
<table cellspacing="0" cellpadding="0" border="0" style="margin: 0px; padding: 0px;">
<tbody>
<tr>
<td class="standartTreeImage">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 18px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/minus.gif");"> </div>
</td>
<td width="16px" style="display: none;">
<div class="dhx_bg_img_fix" style="background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/iconUncheckAll.gif"); width: 18px; height: 18px;"> </div>
</td>
<td class="standartTreeImage" style="width: 16px;">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 16px; height: 16px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/folderOpen.gif");"> </div>
</td>
<td class="dhxTextCell standartTreeRow" nowrap="" style="font-size: 10pt; cursor: pointer;"><span class="standartTreeRow" style="padding-left: 5px; padding-right: 5px;"><font class="tdSmallBlack" onclick="return anchor_onclick(this)" onmouseover="return link_mouseover(this)" onmouseout="return link_mouseout(this)" style="text-decoration: none;"><strong>1mnthuser [Content Provider]<strong></strong></strong></font></span></td>
</tr>
<tr style="">
<td> </td>
<td colspan="3">
<table cellspacing="0" cellpadding="0" border="0" style="margin: 0px; padding: 0px;">
<tbody>
<tr>
<td class="standartTreeImage">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 18px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/minus.gif");"> </div>
</td>
<td width="16px" style="display: none;">
<div class="dhx_bg_img_fix" style="background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/iconUncheckAll.gif"); width: 18px; height: 18px;"> </div>
</td>
<td class="standartTreeImage" style="width: 16px;">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 16px; height: 16px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/folderOpen.gif");"> </div>
</td>
<td class="dhxTextCell standartTreeRow" nowrap="" style="font-size: 10pt; cursor: pointer;"><span class="standartTreeRow" style="padding-left: 5px; padding-right: 5px;"><font class="tdSmallBlack" onclick="return anchor_onclick(this)" onmouseover="return link_mouseover(this)" onmouseout="return link_mouseout(this)"><strong>BMS_MKT_608[Market Plan]<strong></strong></strong></font></span></td>
</tr>
<tr style="">
<td> </td>
<td colspan="3">
<table cellspacing="0" cellpadding="0" border="0" style="margin: 0px; padding: 0px;">
<tbody>
<tr>
<td class="standartTreeImage">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 18px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/blank.gif");"> </div>
</td>
<td width="16px">
<div class="dhx_bg_img_fix" style="background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/iconUncheckAll.gif"); width: 18px; height: 18px;"> </div>
</td>
<td class="standartTreeImage" style="width: 16px;">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 16px; height: 16px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/leaf.gif");"> </div>
</td>
<td class="dhxTextCell standartTreeRow" nowrap="" style="font-size: 10pt; cursor: pointer;"><span class="standartTreeRow" style="padding-left: 5px; padding-right: 5px;"><font class="tdSmallBlue" onclick="return anchor_onclick(this)" onmouseover="return link_mouseover(this)" onmouseout="return link_mouseout(this)"><strong>sss<strong></strong></strong></font></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="">
<td> </td>
<td colspan="3">
<table cellspacing="0" cellpadding="0" border="0" style="margin: 0px; padding: 0px;">
<tbody>
<tr>
<td class="standartTreeImage">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 18px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/blank.gif");"> </div>
</td>
<td width="16px">
<div class="dhx_bg_img_fix" style="background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/iconUncheckAll.gif"); width: 18px; height: 18px;"> </div>
</td>
<td class="standartTreeImage" style="width: 16px;">
<div class="dhx_bg_img_fix" style="padding: 0px; margin: 0px; width: 16px; height: 16px; background-image: url("http://localhost:48081/Airtel_BMS_V4/TreeMenu/imgs/csh_red/leaf.gif");"> </div>
</td>
<td class="dhxTextCell standartTreeRow" nowrap="" style="font-size: 10pt; cursor: pointer;"><span class="standartTreeRow" style="padding-left: 5px; padding-right: 5px;"><font class="tdSmallBlue" onclick="return anchor_onclick(this)" onmouseover="return link_mouseover(this)" onmouseout="return link_mouseout(this)"><strong>sss<strong></strong></strong></font></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
CSS:
#smsTree tr:not(:last-child) {
border-left: 1px solid #ccc;
}
#smsTree tr:first-child:before {
border-bottom: none;
}
#smsTree tr:before {
content: "";
position: absolute;
left: 20px;
z-index: 100;
width: 20px;
height: 10%;
border-bottom: 1px solid #ccc;
}
#smsTree tr:last-child:before {
border-left: 1px solid #ccc;
}
Пожалуйста, проверьте ссылку выше.
Привязка дизайна Древовидная структура: