Insert image in <td> with different resolution
I have a table with 3 rows and one of them:
<tr> <td>Logo Programma</td> <td>Giorno</td> <td>Giorno</td> <td>Put the image here</td> </tr> Now I want to add an image, and I used a tag like this
<td><img src="image.jpg" alt=""></td> The resolution is 788x592, but I do not want to use 788x592 pixels, it will be huge! Therefore, I want to keep the proportions, but with a lower resolution.
+4
2 answers
To maintain image proportions when setting a new size, do something like this:
<td><img src="image.jpg" alt="" style="width:200px; height:auto;"></td> This will set the width to 200px and the height will automatically change to keep the aspect ratio. You can also calculate the height that should be and add it as a fixed number.
+4