How do I place an image to fit perfectly in a table?
-
Hi,
This is my first time using WordPress and I really need help with this one. Currently, I’m creating a theme for personal use. I have a table so that the content of the post would fit perfectly into it. The table has a width of 596px with left and right padding of 30. So basically, the content would fill in the 536px area.
It works fine with text and small images, but when I insert a full-size image with a width of exactly 536, it makes the table wider and that rearranges other things on the page 🙁
I searched around the web and found this css code:
p img {
padding: 0;
max-width: 100%;
}
img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}
img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}
img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}
.alignright {
float: right;
}
.alignleft {
float: left
}I use a Mac and adding the above code fixes my problem in Safari and Chrome. However, when I test it with Firefox and IE (using Parallel), the problem is still there.
You can see my still under-construction blog at:
asyllable.com/Can anyone help so it works across all browsers?
- The topic ‘How do I place an image to fit perfectly in a table?’ is closed to new replies.