我需要给放在另一个表第三行的表应用样式,
<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%;
}
关于html - 将样式应用于放置在另一个表中的特定子表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52387773/