0

我有一个带有标题的小表格,在我向表格添加了更多带有输入的行之后,标题开始不占用表格的整个宽度。有什么建议吗?将不胜感激。

HTML

<table id = "table">
<th id = "header">HEADER</th>
<tr id = "row">
    <td><input type = "text" id = "det_0_0"></td>
    <td><input type = "text" id = "det_0_0"></td>
    <td><input type = "text" id = "det_0_0"></td>
</tr>
<tr id = "row">
    <td><input type = "text" id = "det_0_0"></td>
    <td><input type = "text" id = "det_0_0"></td>
    <td><input type = "text" id = "det_0_0"></td>
</tr>
<tr id = "row">
    <td><input type = "text" id = "det_0_0"></td>
    <td><input type = "text" id = "det_0_0"></td>
    <td><input type = "text" id = "det_0_0"></td>
</tr>
</table>

css

#table{
width:30%;
height:200px;
margin-left:auto;
margin-right:auto;
margin-top:50px;
border:2px inset rgb(0,0,0);
border-collapse:collapse;
}
#header{
height:25px;
max-height:25px;
text-align:center;
font-size:16px;
width:100%;
font-family:Georgia, serif;
background-color:rgb(30,114,41);
color:rgb(245,245,250);
border-bottom:2px inset rgb(0,0,0);
}
#row{
font-size:14px;
font-family:Georgia, serif;
word-wrap:break-word;
background-color:rgb(255,255,255);
}
4

1 回答 1

0

利用

<th id = "header" colspan="3">HEADER</th>
于 2013-05-02T11:04:13.327 回答