html - Placing a png image in a table -
hi know simple question. unable it. want place images in table. working fine in new html file. when trying insert table in project file, images getting overlapped.they not fitting in table. mistake doing? kindly @ image attached.
table,td,th {border: 3px solid black;padding: 15px}
<table> <tr><th>choose icons</th></tr> <tr><td ><img src='http://www.freeiconspng.com/uploads/smiley-icon-1.png' width='20%'/></td></tr> <tr><td ><img src='http://www.freeiconspng.com/uploads/smiley-icon-1.png'width=20%/></td></tr> </table>
try:
table, td, th { border: 3px solid black; padding: 15px } img.icon { width: 20%; height: auto; }
<table> <tr> <th>choose icons</th> </tr> <tr> <td> <img src='heart1.png' class="icon" /> </td> </tr> <tr> <td> <img src='heart1.png' class="icon" /> </td> </tr> </table>
Comments
Post a Comment