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 p
as 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
Post a Comment