?
Solved

How can I emulate a 2-Col table with DIV using CSS?

Posted on 2006-11-30
3
Medium Priority
?
539 Views
Last Modified: 2008-01-09
I am blogging on blogger and I want to mix in images with my text.  Normally I would make a 2-column table, with the first cell containing my text, and the next cell containing my image.  I got set valign=top and all would be good.

<table>
  <tr>
     <td valign=top>
          yadayadayada
     </td>
     <td valign=top>
         <img src="yada.gif">
    </td>
  </tr>
</table>

When I do this on blogger, I get a huge gap above and blow the table.  I want the text to flow nicely and render the image in the righthand column, and I think that I can only do this with 2 div's and some position or flow attributes.  Can someone give the proper markup to achieve this without using tables?
0
Comment
Question by:kraffay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 18047266
Greetings kraffay,

<div>
<img src="yada.gif" style="float:right;margin:0 0 0 10px;"></img>
yadayadayada
<span style="clear:right;font-size:1px;">&nbsp;</span>
</div>

The span is used to clear the float incase the text is less than the height of the img

Regards
0
 
LVL 9

Author Comment

by:kraffay
ID: 18047521
Steggs,

Thanks for the prompt response.  I tried this on my blog and can't seem to get the text to flow on the left side of the image (I was hoping for a 50/50 split).  You can see the results at:

http://integrityconsulting.net/blog/2006/11/how-not-to-do-ajax.html

My markup looks like this:

<div>This measly ....
<img src="http://media.doitbest.com/products/623917.gif" style="float:right;margin:0 0 0 10px;"></img>
<span style="clear:right;font-size:1px;">&nbsp;</span>
</div>

Any ideas?
0
 
LVL 30

Expert Comment

by:Steggs
ID: 18047893
The text has to come after the float mate
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question