我i需要修改的是第8列的列宽,现在的代码只能修改前7列
时间: 2024-04-17 08:26:15 浏览: 14
如果您只想修改第8列的列宽,您可以使用以下CSS选择器来设置:
```html
<html>
<head>
<meta charset="UTF-8">
<title>鉴本</title>
<style>
table {
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1.5px solid black;
padding: 5px;
}
table img {
max-width: 150px;
height: auto;
}
td:nth-child(1) input,
td:nth-child(2) input,
td:nth-child(3) input,
td:nth-child(4) input,
td:nth-child(5) input,
td:nth-child(6) input,
td:nth-child(7) input {
width: 80px;
}
td:nth-child(8) input {
width: 300px;
}
</style>
</head>
<body>
<!-- 表格内容 -->
</body>
</html>
```
在上述修改中,我将选择器`td:nth-child(9) input`更改为`td:nth-child(8) input`,这样就可以正确地设置第8列的宽度为300px。
请将修改后的代码添加到您的HTML文件中,并检查是否可以正确地设置第8列的列宽。如果问题仍然存在,请提供更多详细信息,以便我可以更好地帮助您解决问题。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)