简体   繁体   中英

Aligning image to the top of a table cell

在此输入图像描述

I'm designing a wordpress page inside of the wordpress editor, and I can't figure out how to get the grey image placeholder to align to the top of the table cell. As long as the text in the left cell doesn't go below the grey image, everything is fine. But as soon as the text gets below the bottom of the image, the image pushes down. Here's the code:

<table border="1">
<tbody>
<tr>
<td style="vertical-align: top;">
<img class="alignleft size-full wp-image-71" alt="webi" src="#" 
width="437"     height="114" />                                                                      
&nbsp;
<p>
SOME TEXT
</p>
</td>
<td style="width: 355px;">
<img class="alignright size-full wp-image-61"   alt="palvelut_kuvapaikka" 
src="#"  
align="top" width="355" height="355" /> 
 </td>
</tr>
</tbody>
</table>

只需在右侧td设置vertical-align: top属性?

将它对齐到需要在css中使用的表格的顶部: vertical-align: top

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM