replace table w/ div tag. how?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jaYPee

    replace table w/ div tag. how?

    anyone know how can I replace this code using only the div tag? I have
    tried everything but I can't do it.

    here's the code using table:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>Untitl ed Document</title>
    </head>

    <body>
    <table width="799" align="center" style="border:1 px solid #999999">
    <tr>
    <td><div id="sidebar" style="border:1 px solid #999999; width:
    160px; float:left">
    <h2>sidebar</h2>
    <ul id="nav">
    <li><a href="#">Test Link One</a></li>
    <li><a href="#">Test Link Two</a></li>
    <li><a href="#">Test Link Three</a></li>
    <li><a href="#">Test Link Four</a></li>
    <li><a href="#">Test Link Five</a></li>
    </ul>
    <p>Additional sidebar content.</p></div>

    <div id="maincontent " style="border:1 px solid #999999; margin:0 0 0
    2px; float:left">
    <h2>main content</h2>
    <p>Testing</p>
    </div></td>
    </tr>
    </table>
    </body>
    </html>

    thanks for any help
  • Erwin Moller

    #2
    Re: replace table w/ div tag. how?

    jaYPee wrote:
    [color=blue]
    > anyone know how can I replace this code using only the div tag? I have
    > tried everything but I can't do it.
    >
    > here's the code using table:
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    > "http://www.w3.org/TR/html4/loose.dtd">
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    > <title>Untitl ed Document</title>
    > </head>
    >
    > <body>
    > <table width="799" align="center" style="border:1 px solid #999999">
    > <tr>
    > <td><div id="sidebar" style="border:1 px solid #999999; width:
    > 160px; float:left">
    > <h2>sidebar</h2>
    > <ul id="nav">
    > <li><a href="#">Test Link One</a></li>
    > <li><a href="#">Test Link Two</a></li>
    > <li><a href="#">Test Link Three</a></li>
    > <li><a href="#">Test Link Four</a></li>
    > <li><a href="#">Test Link Five</a></li>
    > </ul>
    > <p>Additional sidebar content.</p></div>
    >
    > <div id="maincontent " style="border:1 px solid #999999; margin:0 0 0
    > 2px; float:left">
    > <h2>main content</h2>
    > <p>Testing</p>
    > </div></td>
    > </tr>
    > </table>
    > </body>
    > </html>
    >
    > thanks for any help[/color]

    Hi,

    You can achieve that by using innerHTML, google for it.
    But what excactly has this question to do with PHP?
    You might get luckier in a DHTML or JS newsgroup. :-)

    Regards,
    Erwin Moller

    Comment

    • Rincewind

      #3
      Re: replace table w/ div tag. how?

      On Wed, 28 Sep 2005 14:54:10 +0800, jaYPee wrote:
      [color=blue]
      > anyone know how can I replace this code using only the div tag? I have
      > tried everything but I can't do it.[/color]

      <snip>

      Take a look here http://glish.com/css/ or here
      http://www.positioniseverything.net/ and you would do better to ask at
      alt.html or comp.infosystem s.www.authoring.stylesheets in future.

      Comment

      Working...