Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Table align images and text

Tags:

html

In a sample article I added a html table widh 2 columns, left column for images and right column for image descriptions.

The problem is, the text description on the right column is below the images, it´s like the images are forcing the text to break into another line.

this is a sample code as I used:

<table>
<tr>
<td>Image.jpg</td>
<td>Image.jpg description</td>
</tr>
<tr>
<td>Image2.jpg</td>
<td>Image2.jpg description</td>
</tr>
</table>

You can see the problem here On this page

like image 490
Ricardo Ribeiro Avatar asked Jan 16 '23 22:01

Ricardo Ribeiro


1 Answers

You just have to add style="vertical-align:top" to td

Or vertical-align:middle if you'd like to position the text in the middle of the row

like image 186
kpotehin Avatar answered Jan 24 '23 17:01

kpotehin