How to get elastic table next to a image?

Posted by Pavel Chuchuva on Stack Overflow See other posts from Stack Overflow or by Pavel Chuchuva
Published on 2010-04-30T05:34:37Z Indexed on 2010/04/30 5:37 UTC
Read the original article Hit count: 390

Filed under:
|
|

This is what I want:

This is the best I could come up with:

CSS

img
{
  background: red;
  float: left;
}

table
{
  background: yellow;
  width: 90%;
}

HTML

<img src="image.jpg" width="40" height="40" />
<table>
  <tr><td>Table</td></tr>
</table>

There is a problem with this approach. If you resize browser window at some point the table jumps below the image: click to view demo.

What is the better way of achieving this layout?

© Stack Overflow or respective owner

Related posts about css

Related posts about css-layout