+ 1

how can add image and center in table html

tables

3rd Jul 2016, 11:11 PM
augustin maputol
augustin maputol - avatar
2 Answers
0
Hi, you need to put the align attribute in the td tag. You could use the code below. <td align="center"> <img src="http://www.sololearn.com/images/tree.jpg" width="100px" height="100px" alt="" /> </td>
4th Jul 2016, 12:12 PM
Alex Harrod
0
Code: <!doctype html> <head> <title>Example</title> <style> //this stylesheet adds a center-attribute to all tables with class center table.center{ text-align:center; } img{ display:inline-block; } </style> </head> <body> <!--A table with class center--> <table class=center> <!--a line in that table--> <tr> <td> <!--a picture--> <img src="irgendeinbild.png"> </td> </tr> </table> </body>
4th Jul 2016, 12:18 PM
Felix Fischl
Felix Fischl - avatar