2 列,几行。整个桌子的宽度似乎设置得很好。没有机会改变它。我所能做的就是移动行分隔符,以便一列被拉伸而另一列扩展。
这是 CSS 文件。
body {
font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
background: #E6EAE9;
}
a {
color: #c75f3e;
}
#mytable {
width: 450px;
padding: 0;
margin: 0;
height: 39px;
}
caption {
padding: 0 0 5px 0;
width: 489px;
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
text-align: right;
}
th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
padding: 6px 6px 6px 12px;
background: #CAE8EA url(images/bg_header.jpg) no-repeat;
}
th.nobg {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
td {
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #4f6b72;
}
td.alt {
background: #F5FAFA;
color: #797268;
}
th.spec {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #fff url(images/bullet1.gif) no-repeat;;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th.specalt {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #f5fafa url(images/bullet2.gif) no-repeat;;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #797268;
}
而这张桌子。
<table id="mytable" cellspacing ="0">
<caption>Table 1: Descriptions </caption>
<tr>
<th scope="col" abbr="Configurations" class="nobg" style="width: 47px">Configurations</th>
<th scope="col" abbr="Dual 1.8GHz">Original Stack</th>
</tr>
<tr>
<th scope="row" class="spec" style="width: 47px">Model</th>
<td class="style1">3xPa</td>
</tr>
<tr>
<th scope="row" class="specalt" style="width: 47px">Year</th>
<td class="alt" style="width: 181px">1998/A</td>
</tr>
</table>
我不确定是什么阻止我改变整个表格的宽度。我尝试更改 #mytable 中的 width 属性,但它完全没有做任何事情。我正在使用 VS 2010,aspx 网络表单。
任何的想法?