- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在尝试通过其他帖子的提示找到这个问题的答案 CSS Selector picker/finder?我发现做我想做的最接近的部分解决方案是: http://asp-net-example.blogspot.com/2009/04/how-to-set-change-treeview-parent-node.html
我只需要将所有父节点的背景颜色设置为#F0F0F0正如您在上面的链接中看到的,下面的行只会为父区域设置背景颜色,但不会为整个行设置背景颜色。我想让所有的父节点行都具有相同的背景颜色。
<ParentNodeStyle Font-Bold="False" BackColor="#F0F0F0"/>
我还尝试了 nth-child 的不同组合,包括下面的行,但它不起作用:
table.trvFileTree tr:nth-child(2)
{
background-color: #F0F0F0;
}
我使用了 Dom Inspector 插件,如您所见,我希望所有第二个 trs 都具有特定的背景颜色。
此外,我尝试使用 Firebug 获取第二个 tr 选择器的完整路径:
html body form#form1 div div.fullWidthWrp div.InnerfullWidth div.LCol div.InnerLCol div#trvFileTree.treeViewDim div#trvFileTreen0Nodes table tbody tr
非常感谢您的提前帮助。
注意:无法在 stackoverflow 上发布屏幕截图,因为它需要超过 10 个信誉点。但是,我在 droplr 图像共享网站上发布了我需要的屏幕截图:http://d.pr/i/OVIp
更新(下面的代码几乎与我的代码完全相同,但我决定只为 TreeView 添加代码,以便代码仅显示需要完成的操作):
1) 这是 TreeviewExample.aspx 的完整代码 ideone.com/3PXbSE
2) 这是 TreeviewExample.aspx 的完整渲染标记 ideone.com/wpctLP
3) 这是TreeviewExample.aspx的浏览器 View 截图 d.pr/i/8ni6
正如您将在 #2 中看到的完整代码)与下面呈现的代码几乎相同(具有相同的表结构)
下面的标记是由 treeview 控件生成的代码的一部分,并显示了我想要具有不同背景颜色的父节点行:(从 firebug 复制,仅扩展了一些重要节点,以便标记更容易阅读)
<div id="trvFileTree" class="treeViewDim" style="width: 100%;">
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
<tbody>
<tr>
<tr style="height: 0px;">
</tbody>
</table>
<div id="trvFileTreen0Nodes" style="display: block;">
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
<tbody>
<tr style="height: 0px;">
<tr> <%--This row contains a parent node, and I want to set the background color for all the row--%>
<tr style="height: 0px;">
</tbody>
</table>
<div id="trvFileTreen1Nodes" style="display: block;">
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
<tbody>
<tr style="height: 0px;">
<tr> <%--This row also contains a parent node, and I want to set the background color for all the row--%>
<tr style="height: 0px;">
</tbody>
</table>
<table cellspacing="0" cellpadding="0" style="border-width: 0;"> <%--These tables contain child nodes--%>
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
</div>
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
<div id="trvFileTreen5Nodes" style="display: none;">
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
<tbody>
<tr style="height: 0px;">
<tr>
<tr style="height: 0px;">
</tbody>
</table>
</div>
<table cellspacing="0" cellpadding="0" style="border-width: 0;">
最佳答案
如果我理解你的问题,我有东西要给你。
试试这个:
table tr:not(:nth-child(2n)){
background-color: #F0F0F0;
}
来源:
关于asp.net - TreeView 如何使用 css 在表中选择 2nds tr 以设置完整父节点行的 BackColor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16182428/
我想要数组中所选 tr 的所有下一个 tr 的 data-id。我使用此代码,但这不是一个好代码。 var ids = Array.prototype.slice.call($("tr.selecte
JSFiddle:http://jsfiddle.net/9u8tnh97/ 我正在使用 jQuery 和 Bootstrap。我有一张 table 4 像这样的元素:
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
在 Notepad++ 中,我试图制作一个正则表达式来匹配标签。起初,我认为必须转义大括号,所以我尝试了 \ .然而,这不仅符合我预期的开始标签,而且匹配所有 。 s( 和 )。这是为什么? 最佳答
我正在尝试定位其中包含子表行元素的表中的最后一个父表行。我已尝试使用下面的 jQuery 来定位 :last 伪值,但是,如预期的那样,它的目标是目标父表中的绝对最后一个表行元素。 $('table[
我想插入新的在每个现有的 之后。我的功能: var element = document.querySelector('tr.cart-item'); var newElement = docume
这个问题在这里已经有了答案: RegEx match open tags except XHTML self-contained tags (35 个答案) 关闭 9 年前。 我希望这个正则表达式匹
生成此代码是为了做两件事。第一个是单击复选框时突出显示表记录。第二个是即使页面刷新也能记住结果。 Untitled Document
嗨,我正在尝试在 tr 数组中查找 tr属性名称是 docId 是否有任何类型的 jquery 选择器? 我不想只用 for 循环遍历数组然后自己去找。 除非你说我别无选择... 谢谢 最佳答案 如果
我有一张 table ,我想在单击加号图标时在 tr 中打开相同的 tr。我不明白我使用哪个 html 元素打开。 请帮帮我。提前致谢。
对你来说是个小问题:-) 我正在使用 BeautifulSoup 来解析 HTML 页面中表格的内容。问题是在我的输出文件的每一行(CSV/EXCEL)之间,它拉出一个空行......这是 HTML
我制作了一个包含基本信息的表格,每个奇数行和偶数行都有不同的颜色。在 :hover影响它是橙色的,不管它是偶数还是奇数。 但是当我想“分组”3 我发现了一个问题。我试着把它包装成 但它没有用。我的目标
在 lxml 中,我使用 xpath 选择表(具有不同行数)中的所有 tr,除了包含乱码的最后两行。 是否有排除最后两行的模式匹配?我正在浏览 xpath 教程,显然有一个“except”运算符和一个
我在表列表中显示来自数据库的记录。此外,我在每一行中都有一个跟进按钮,如果任何用户单击跟进按钮,则会为特定用户打开一个包含详细信息的弹出窗口。 或者任何其他想法来处理这个问题? 我试过用这样的东西
我有以下表格结构。 当我点击 时我想添加新的 在 旁边其中被点击。 所以结果会是:
使用这个 HTML: 1 2 3 4 我得到这个输出: 1 2 3 4 但我想要的是: 1 2 3 4 如何
嗨,我有一个表格,我在这里做了一些代码来将表格更改为可编辑和可选择...我的要求是 1.当点击一个TR时,它应该变成蓝色,再次点击另一个TR,它将显示蓝色,旧的TR变成白色(威胁不可选择) 我由于一些
这个问题可能令人困惑,但这就是确切的情况.. 我已经动态生成了一些(根据从数据库获取的数据),现在我想允许用户选择其中一个单选按钮,并且我想捕获所单击的行的详细信息,因此请检查我的代码并协助 我的aj
免责声明:HTML、JQuery、Ajax 技能水平 — 垃圾。一直是一个厚客户。 我有一个表单,允许用户输入客户代码和电子邮件地址。我想在客户代码有效时显示客户的姓名。我会错误地通过 Ajax 和
正在尝试添加 其他元素 表中的元素根据 的行跨度该特定元素 元素。在同一功能中,单击 中的此按钮后元素的行数每次增加1,因此也需要增加行数。不知道该怎么做。也许使用 slice()以某种方式发挥作
我是一名优秀的程序员,十分优秀!