CSS:CSS定位困難
.one {
width: 13%;
}
.two {
width: 30%;
}
.three {
width: 30%;
}
HTML:
<table>
<tr>
<th class= "one">Quantity</th>
<th class= "two">Info</th>
<th class= "three">Price</th>
</tr>
<tr>
<td class = "one"><input type="text" name="quantity1" value=""/>
<td class = "two">Cheap Monday Jeans 30/34 </td>
<td class = "three">$39.99 </td>
</tr>
<tr>
<td class = "one"><input type="text" name="quantity2" value=""/></td>
<td class = "two">Herschel Bag (free) </td>
<td class = "three">$129.99 </td>
</tr>
<tr>
<td class = "one"><input type="text" name="quantity3" value=""/></td>
<td class = "two">Diesel t-shirt (s) </td>
<td class = "three">$59.99 </td>
</tr>
<tr>
<td class = "one"><input type="text" name="quantity4" value=""/></td>
<td class = "two">Superdry Patrol Lite Jacket (m) </td>
<td class = "three">$129.99 </td>
</tr>
<tr>
<td class = "one"><input type="text" name="quantity5" value=""/></td>
<td class = "two">I love Canada t-shirt (s) </td>
<td class = "three">$19.99 </td>
</tr>
</table>
我想錶行(衣物信息&價格)正下方的表頭對齊。意思是,我希望它被集中。我不知道爲什麼表格行向左傾斜,不能在頁眉正下方對齊。
偶試過 td {text-align:center; },但不起作用。
幫助將不勝感激,謝謝。
請[編輯](http://stackoverflow.com/posts/17983973/edit)你的前一個問題,而不是重新發布它。同時向我們展示如何嘗試「文本對齊」以及爲什麼無法使用。 – Bergi
這裏的作品很好http://jsfiddle.net/u7WzM/ –