+ 1
how can add image and center in table html
tables
2 odpowiedzi
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>
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>