Styling <tr> in Treeview
I'm working o开发者_JS百科n an ASP.net 2.0 application.
The master stylesheet contains:
BODY TR
{
background-color: #e5e4e4;
}
In a page I'm creating for the site I have an:
<asp:TreeView>
Each line in the TreeView renders as a <table>. Each table contains a <tr> which picks up on the background colour in the stylesheet. I don't want them to.
By giving my <asp:TreeView> the following:
ForeColor="black"
LeafNodeStyle-BackColor="white"
NodeStyle-BackColor="White"
ParentNodeStyle-BackColor="White"
RootNodeStyle-BackColor="White"
BackColor="White" BorderColor="White"
style="background-color:White;"
I can get most of it to render with a white background. The <td>s that contain data have this as their style:
white-space: nowrap; background-color: White;
The <td>s that contain no data and are used to indent nodes still have the unwanted background colour.
How can I style the intent <td>s or override the stylesheet?
Thanks in advance.
Just use
<asp:Treeview CssClass="myTreeClass">
and define in CSS
body .myTreeClass tr{background-color:white;}
table tr td
{
background-color: white;
}
精彩评论