ASP Treeview控件

时间:2013-08-06 18:11:00

标签: jquery asp.net css

所以我的网站上有一个asp:treeview控件,但我想改变它的一些内容。以下是asp:treeview为父节点的给定子节点生成的内容。我想删除

<td> <div style="width:0px;height:1px"></div> </td>

但我不确切知道如何(有不必要的间距,我想删除它)。我确实在StackOverflow上找到了一个可能的解决方案。解决方案是将其放在我的.css页面中:

.CategoryTreeView .TreeView table tbody tr td:first-child { display:none; }

虽然这有点奏效,它取出了父节点,但我只留下了子节点。所以不要这样:

All Products
    Evergreens
    Oaks

我只剩下:

Evergreens
Oaks

----父节点生成的代码----

<table cellpadding="0" cellspacing="0" style="border-width:0;">
    <tbody>
        <tr>
            <td class="NodeStyle RootNodeStyle SelectedNodeStyle"href="category.aspx?zcid=130" 
            id="ctl00_ctl00_MainContent_uxCategory_CATEGORIES_ctrlNavigationn0" style="border-style:none;font-size:1em;">All Products</a></td>
        </tr>
    </tbody>
</table>

----儿童节点生成的代码----

<table cellpadding="0" cellspacing="0" style="border-width:0;">
    <tbody>
        <tr>
            <td>
                <div style="width:0px;height:1px"></div>
            </td>
            <td class="LeafNodeStyle" href="category.aspx?zcid=131" id="ctl00_ctl00_MainContent_uxCategory_CATEGORIES_ctrlNavigationn1" 
            style="border-style:none;font-size:1em;">Evergreens</a></td>
        </tr>
    </tbody>
</table>

1 个答案:

答案 0 :(得分:0)

我最终选择了:

.CategoryTreeView div div div table tbody tr td:first-child {display: none; }

它对我有用。

相关问题