tags:

views:

42

answers:

2

How to translate code below to use three div and look the same ?

 <table width="1050px">
      <tr>
        <td rowspan="2" width="80%"></td>
        <td width="20%"><p>some text</p></td>
      </tr>
      <tr>
        <td><p>some text</p></td>
      </tr>
    <table>
+5  A: 

There is no rowspan, however you can achieve the same result with the following:

<div style="width: 1050px;">
    <div style="width: 80%; float: left;">
        <p>some text</p>
    </div>
    <div style="width: 20%; float: left;">
        <p>some text</p>
    </div>
    <div style="width: 100%; clear: left;">
        <p>some text</p>
    </div>
</div>

See working example.

Dustin Laine
Thanks a lot !!!
Jenny
A: 

Here's pretty much the same answer as Dustin with a little color thrown in and using both paragraphs and lists in the right column.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
   <html> 
   <head> 
      <title>Default</title> 
      <style type="text/css" media="all">
ul { list-style-type: none;
margin-left: 0;
padding-left: 0;}
</style> 
   </head> 
   <body> 
 <table width="1050px"> 
      <tr> 
        <td rowspan="2" width="80%" >a</td> 
        <td width="20%" style="background-color: yellow;"><p>some text</p></td> 
      </tr> 
      <tr> 
        <td style="background-color: yellow;"><p>some text</p></td> 
      </tr> 
    <table> 
<div style="width: 1050px;"> 
    <div style="width: 80%;float: left;">a</div> 
    <div style="width: 20%; float: left; background-color: yellow;">
<p>some text using paragraphs</p><p>some text</p>
<ul>
<li>some text using lists</li>
<li>some text</li>
</ul>
</div>
</div>
   </body> 
   </html>
Traingamer
Thanks a lot !!!
Jenny