我需要将样式应用于放置在另一个表格第三行的表格,
<html>
<head>
<title>HTML Table</title>
</head>
<body>
<table class="wizard-ux">
<tbody>
<tr>
<table>
<tr>
<td>test Table 2</td>
<td>test Table 2</td>
</tr>
</table>
</tr>
<tr>
<table>
<tr>
<td>test Table 2</td>
<td>test Table 2</td>
</tr>
</table>
</tr>
<tr>
<td>
<table>
<tr>
<td>Save (Width has to be 90%)</td>
<td>Cancel (Width has to be 10%)</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
由于这是 asp.net 向导,我没有子表的 id 或类,唯一的引用是父表的"wizard-ux"。我需要通过CSS将第一列的宽度设置为90%,将第二列的宽度设置为10%,
有人可以为此建议一个CSS吗,
提前感谢,
试试下面的CSS
.wizard-ux tr:last-of-type table td:first-of-type
{
width:90%;
}
.wizard-ux tr:last-of-type table td:last-of-type
{
width:10%;
}
我已经尝试通过为这些列提供 id 来尝试
<td id="wid90">Save</td>
<td id="win10">Cancel</td>
然后我用这个 css
#wid90 {
width: 90%
}
#wid10 {
width: 10%
}
我不知道它是否有效