How to Add Image inside Table Cell in HTML ? Last Updated : 23 May, 2025 Comments Improve Suggest changes Like Article Like Report Adding images inside HTML table cells can enhance the visual appeal of your tables by up to 60%, making your content more engaging and easier to understand. This approach allows you to effectively present visuals alongside text for better communication and user experience.Image inside Table CellThese are the following approaches:Using <img> tag inside <td>This approach involves using the <img> tag within a <td> element to directly embed an image in the table cell. The src attribute of the <img> tag specifies the URL or path of the image.Example: This example shows the adding of image into the table cell using <img> tag. index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Table with Image and Headers</title> <style> img { height: 40px; width: 50px; } h1 { color: green; } .container { text-align: center; } table { margin-left: 32%; } </style> </head> <body> <div class="container"> <h1>GeeksForGeeks</h1> <h3>Adding image inside table cell</h3> <table border="1"> <tr> <th>Course Name</th> <th>Description</th> <th>Image</th> </tr> <tr> <td>DSA self placed course</td> <td>Learn with gfg</td> <td> <img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20220519152227/DSA-course-by-Sandeep-Jain-banner.jpg" alt="Image"> </td> </tr> <tr> <td>AI for beginners</td> <td>Learn Ai</td> <td> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20230911173805/What-is-Artiificial-Intelligence(AI).webp" alt=""> </td> </tr> </table> </div> </body> </html> Output: Adding Image inside table cellUsing CSS background-image propertyThis approach involves CSS to set a background image for an <td> element using background-image. Use different properties like background-size, background-position, and background-repeat to style the background image appearance.Example: This example shows the adding of image into the table cell using background-image property. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Table with Image and Headers</title> <style> img { height: 40px; width: 50px; } .container { text-align: center; } table { margin-left: 41vw; } .image-cell { background-image: url('https://media.geeksforgeeks.org/wp-content/uploads/20210224040124/JSBinCollaborativeJavaScriptDebugging6-300x160.png'); background-size: cover; background-position: center; background-repeat: no-repeat; } </style> </head> <body> <div class="container"> <h3>Adding image inside table cell using CSS </h3> <table border="1"> <tr> <th>Name</th> <th>Founder</th> <th>Image</th> </tr> <tr> <td>GeeksForGeeks</td> <td>Sandeep Jain</td> <td class="image-cell"></td> </tr> </table> </div> </body> </html> Output:Image inside table cell using CSS Comment More infoAdvertise with us Next Article How to Add Image inside Table Cell in HTML ? G ghuleyogesh Follow Improve Article Tags : HTML HTML-Questions Similar Reads How to Add Input Field inside Table Cell in HTML ? In HTML, adding input fields inside the table cells can be done to make the application user interactive and useful in the scenarios of building forms, data entry systems, etc. Below are the approaches to add input field inside a Table Cell in HTML: Table of Content Using 'input' tagUsing data Attri 3 min read How to Add Image in HTML Table ? Adding images to an HTML table can enhance the visual appeal and functionality of your webpage. Whether it is for displaying product images in an e-commerce website or adding profile pictures in a user list, images in tables are a common requirement. In this article, we will explore two methods to a 2 min read How to Insert an Image in HTML? To insert an image in HTML, you can use <img> tag. This tag uses the src attribute to define the URL of the image file. We can also use CSS to insert image in HTML.Table of ContentUsing img TagUsing background-image propertyInsert an Image using img TagThe <img> tag is the primary method 1 min read How to Set Background Image in HTML Table ? Setting a background image in an HTML table can enhance the visual appeal of your webpage. In this article, we will discuss two methods to set a background image in an HTML table i.e. using inline CSS and external CSS. Set Background Image in HTML Table using Inline CSSIn this approach, we directly 2 min read How to merge table cells in HTML ? The purpose of this article is to explore the method of merging table cells in HTML using the rowspan and colspan attributes. By utilizing rowspan, multiple cells in a row can be merged or combined, while colspan enables the merging of cells in a column within an HTML table. This technique proves es 2 min read Like