How to Add Image in HTML Table ? Last Updated : 07 Mar, 2024 Comments Improve Suggest changes Like Article Like Report 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 add images to an HTML table i.e. using plain HTML and using HTML with inline CSS for styling. Add Image in HTML TableIn this method, we'll add images to each row of the table using the <img> tag within plain HTML. HTML <!DOCTYPE html> <html> <head> <title>Table with Images</title> <style> table { margin: auto; } </style> </head> <body> <table border="1"> <tr> <th>Image</th> <th>Name</th> <th>Email</th> </tr> <tr> <td><img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" alt="GFG Logo" width="100" height="100"> </td> <td>XYZ</td> <td>[email protected]</td> </tr> <tr> <td><img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" alt="GFG Logo" width="100" height="100"> </td> <td>ABC</td> <td>[email protected]</td> </tr> </table> </body> </html> Output: ExplanationWe add a new column with the heading "Image" to accommodate the images.Inside each row, under the "Image" column, we insert an <img> element.The src attribute is used to specify the path of the image file.The alt attribute provides alternative text for the image if it cannot be displayed.The width and height attributes are used to set the size of the image.Add Image in HTML Table using HTML and Inline CSSIn this method, we'll add images to the table and use inline CSS to style the images for better presentation. HTML <!DOCTYPE html> <html> <head> <title>Styled Table with Images</title> <style> table { margin: auto; } </style> </head> <body> <table border="1"> <tr> <th>Image</th> <th>Name</th> <th>Email</th> </tr> <tr> <td><img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" alt="GFG Logo" style="width: 100px; height: 100px; border-radius: 50%;"> </td> <td>XYZ</td> <td>[email protected]</td> </tr> <tr> <td><img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" alt="GFG Logo" style="width: 100px; height: 100px; border-radius: 50%;"> </td> <td>ABC</td> <td>[email protected]</td> </tr> </table> </body> </html> Output: ExplanationWe use the same basic structure as in approach 1 (Add Image in HTML Table).In addition to the width and height attributes, we use the style attribute to apply inline CSS styles to the images.The border-radius: 50%; style is used to make the images circular, which is a common design choice for profile pictures.You can add more CSS styles as needed to customize the appearance of the images. Comment More infoAdvertise with us Next Article How to Add Image in HTML Table ? V vkash8574 Follow Improve Article Tags : HTML HTML-Questions Similar Reads How to Add Image inside Table Cell in HTML ? 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 CellThes 2 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 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 add table footer in HTML ? To add a table footer on an HTML table you can use the HTML tfoot tag. The footer is required when the developer wants to show the conclusion or the result of the table data in a single row. Syntax: <tfoot> // Table footer contents... </tfoot> Below example will illustrate the concept of 1 min read How to Create Table in HTML? HTML tables are used for organizing and displaying data in a structured format on web pages. Tables are commonly used for product information, presenting data analytics, or designing a pricing comparison chart. Elements of HTML TableTable ElementsDescription<table>The <table> element def 3 min read Like