Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML中的内容表_Html_Css - Fatal编程技术网

HTML中的内容表

HTML中的内容表,html,css,Html,Css,这是我的代码,但第二个的内容位于的底部 以下是我目前掌握的情况: CSS .TableMarket { font-family: Tahoma; width: 800px; height:800px; background-color: #9ca4b5; margin-left: auto; margin-right: auto; } .TableMarket td { width:400px; height:200px; }

这是我的代码,但第二个
的内容位于
的底部

以下是我目前掌握的情况:

CSS

.TableMarket {
    font-family: Tahoma;
    width: 800px;
    height:800px;
    background-color: #9ca4b5;
    margin-left: auto;
    margin-right: auto;
}

.TableMarket td {
    width:400px;
    height:200px;

}
HTML

<table class="TableMarket" border="1">
  <tr>
    <td style="background-color:#00ff90;">
      <img src="images/a.PNG" />
    </td>
    <td style="background-color:#ff6a00;" >
      <p>
      name....
      family.....
      age....
      </p>
    </td>
  </tr>
</table>


名称
家庭
年龄。。。。


这篇文章附带了一个JSFiddle:

那么,您希望文本位于框的顶部吗

如果是这样,
垂直对齐
起作用

vertical-align: top;
若否,可否澄清;;这有点令人困惑


如果您的问题是如何获取顶部的单元格内容,请尝试以下操作:

.TableMarket td {
    width:400px;
    height:200px;
    vertical-align: top
}

问题是什么?我看到你的表格里有一些很好的垂直对齐的文本…非常感谢你…非常有效:)@mrmarlow非常感谢你@Stefan@Stella如果你的人生目标是不符合现代标准但又能发挥作用,那么你也可以在html中使用“valign='top'作为td的属性。