Html 表格单元格中的文本与标题中的文本不居中

Html 表格单元格中的文本与标题中的文本不居中,html,css,Html,Css,CSS: HTML: 量 信息 价格 廉价星期一牛仔裤30/34 $39.99 赫歇尔包(免费) $129.99 柴油t恤(s) $59.99 超干巡逻Lite导管架(m) $129.99 我喜欢加拿大t恤衫 $19.99 我希望表格行(衣服信息和价格)在表格标题的正下方对齐。我不知道为什么表格行向左倾斜,不能在标题的正下方对齐 首先,在第一次输入后,您忘记关闭td <table> <tr> <th class= "one"&g

CSS:

HTML:


量
信息
价格
廉价星期一牛仔裤30/34
$39.99 
赫歇尔包(免费)
$129.99 
柴油t恤(s)
$59.99 
超干巡逻Lite导管架(m)
$129.99 
我喜欢加拿大t恤衫
$19.99 
我希望表格行(衣服信息和价格)在表格标题的正下方对齐。我不知道为什么表格行向左倾斜,不能在标题的正下方对齐


首先,在第一次输入后,您忘记关闭td

<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>

看看这个

你可以将它添加到你的css中:

td
{
    text-align:center;    
}
您需要
td
前缀,因为您的
th
使用相同的css类


我希望这能有所帮助。

对我有用(Firefox)。你有什么问题?在imagur或其他图像托管网站上发布链接。那会让你更容易。你说的“对齐”是什么意思?你想要吗?嘿,伙计们,我上传了这张照片。如你所见,信息和实际价格在左边。我希望这些是对齐的权利下方的信息和价格。希望这是有意义的。谢谢大家:)它仍然是有效的HTML:-)你们可以尝试从td改为table。。。表{文本对齐:居中;}。这是我可以去看看的地方吗?
 <td class = "one"><input type="text" name="quantity1" value=""/></td>
td
{
    text-align:center;    
}
td.two, td.three {
  text-align:right;
}