【发布时间】:2022-01-15 09:49:36
【问题描述】:
我可以知道为什么我的类“bold-header”样式没有覆盖到表的第一行<tr>?
HTML:
<style>
.bold-header{
background-color:navy;
color:white;
}
</style>
<table border="1">
<tr>
<td>ID</td>
<td>Name</td>
</tr>
<tr>
<td>001</td>
<td>John</td>
</tr>
<tr>
<td>002</td>
<td>Alex</td>
</tr>
<tr>
<td>003</td>
<td>Maxwell</td>
</tr>
</table>
脚本:
d3.select("table").selectAll("td").style("background-color", "lightblue").style("width", "100px");
d3.select("table").select("tr").classed("bold-header", true);
我希望得到这样的结果: my expectation
但它给了我这个: actual result
【问题讨论】:
标签: javascript css d3.js