html - How can I make text in my td wrap when it reaches the width of the image in my td? -


so have <td> in table looks this:

<tr>      <td>         <p class="tabletext">random text goes on long..........</p>         <img src="www.imageurl.com/img.png" width="33vw">     </td>     <td>         <p class="tabletext">random text goes on long..........</p>         <img src="www.imageurl.com/img.png" width="33vw">     </td> </tr> 

what want able do, width of each <td> width of image, text should wrap when reaches width of image next line. however, instead text running on.

is there can in js/jquery,html, or css fix this? (preferably html/css)

just give same width in pas giving img because siblings.

td {    border: red solid  }  img {    display: block;    width: 33vw  }  p {    width: 33vw  }
<table>    <tr>      <td>        <p class="tabletext">random text goes on long..........</p>        <img src="//dummyimage.com/100x100" />      </td>      <td>        <p class="tabletext">random text goes on long..........</p>        <img src="//dummyimage.com/100x100" />      </td>    </tr>  </table>


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -