Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Html To Css

  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post

    Html To Css

    I can't get this table to divs for some reason. I tried float:left for the image div, and float:right for the other 5, but nothing. They lign up under each other.
    anyone???

    Code:
    <table>
    	<tr>
    		<td rowspan="5">IMAGE</td>
    		<td>TEXT NEXT TO IMAGE</td>
    	</tr>
    	<tr>
    		<td>TEXT NEXT TO IMAGE</td>
    	</tr>
    	<tr>
    		<td>TEXT NEXT TO IMAGE</td>
    	</tr>
    		<tr>
    		<td>TEXT NEXT TO IMAGE</td>
    	</tr>
    	<tr>
    		<td>TEXT NEXT TO IMAGE</td>
    	</tr>
    </table>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I think you may be misunderstanding how converting something to CSS works. You don't want to replace every single table cell with a div. That is NOT the way to do things. Something like this should work
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>&nbsp;</title>
    <style type="text/css">
    img.fleft {
    float:left;
    margin-right:3px;
    margin-bottom:3px;
    }
    p {
    margin:0;
    padding:5px;
    }
    </style>
    </head>
    <body>
    <div> <img src="image.jpg" alt="" class="fleft">
    	<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse sit amet purus nec tellus lacinia fermentum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nulla fringilla. Suspendisse potenti. Suspendisse vel leo. Etiam quam. Duis dolor nisl, luctus eget, viverra vel, lobortis eget, justo. Mauris posuere dignissim erat. Morbi venenatis ante a quam. Aliquam erat volutpat. Morbi fermentum. Sed eu augue sollicitudin odio ornare blandit. Integer consequat fermentum nibh. Maecenas mi odio, fringilla non, cursus et, auctor eu, nisl. Nam placerat urna a justo. Sed malesuada lectus sit amet lacus. Etiam et ipsum ac felis scelerisque ullamcorper. Morbi fringilla metus vitae nisl. Quisque ornare lobortis purus. </p>
    	<p> Quisque enim neque, sodales eu, tincidunt vel, malesuada sit amet, pede. Vivamus orci dolor, ultrices id, porta tincidunt, malesuada et, arcu. Praesent volutpat pharetra nibh. Suspendisse magna. Aenean ac metus id velit pulvinar consectetuer. Nullam at ligula. Nullam vehicula sem sit amet magna. Quisque nonummy vestibulum eros. Curabitur sed orci. Nam blandit. Proin sed lacus. Suspendisse in nulla. Mauris nec risus. Aenean rutrum. Ut dapibus ligula in quam. Ut condimentum. Duis id mauris quis sem venenatis posuere. Etiam sapien. Morbi consectetuer porta tortor. Nulla ut justo. </p>
    	<p> Aliquam sed risus. Quisque facilisis mauris eu nulla. Morbi vitae eros iaculis lorem tempor nonummy. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Morbi eleifend. Sed gravida elementum neque. Ut non ipsum non erat fermentum elementum. Vestibulum quis diam vitae ante adipiscing volutpat. Fusce metus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas orci. Cras a est. Praesent nisi turpis, tempus nec, lobortis quis, vehicula nec, nunc. Donec viverra turpis sed odio. Nullam malesuada pede quis dui. In ac diam. Donec consequat purus sed ligula. Vivamus eget tortor. Nunc a lectus eu turpis accumsan volutpat. </p>
    </div>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •