Results 1 to 4 of 4

Thread: no more tables

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default no more tables

    Someone told me there where too many table tags in this code. How do I replace them using CSS ?

    Code:
    <html>
    <head>
    <script language="JavaScript" type="text/JavaScript">
    function clearDefault(el) {
    if (el.defaultValue==el.value) el.value = ""
    }
    </script>
    
    </head>
    
    <body background="bgpalet.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    <table width="80%" height="100%" border="0" cellpadding="0" cellspacing="0" align=right>
    <tr><td align="center" valign="middle">  
    
    <table border="0" width=100% align=right>
    <tr><td width="120" valign="middle">
    
    </td><td valign="middle" align="right">
    
    <FORM NAME="form1" METHOD="post" ACTION="contact.php">
    
    <table width="100%" valign="top" align=center>
    <tr><td>
    <table width=100%>
    <tr><td align=left>
    <INPUT TYPE=TEXT NAME="name" VALUE="your name" onFocus="clearDefault(this)" style="border:1px solid #666666; width:190px">
    </td></tr>
    <tr><td align=left>
    <INPUT TYPE=TEXT NAME="email" VALUE="your e-mail" onFocus="clearDefault(this)" style="border:1px solid #666666; width:190px">
    </td></tr></table>
    </td><td width=20>
    &nbsp</td><td align=left valign=middle>
    <INPUT TYPE="image" src="emailgo.jpg" NAME="submit" VALUE="go" style="border: 0px">
    </td></tr></table>
    
    <table width="100%" valign="top" align=center>
    <tr><td align=right>
    <TEXTAREA NAME="message" style="border:1px solid #666666; width:265px; height:120px">
    </TEXTAREA>
    </td></tr></table>
    
    
    </FORM>
    
    </td></tr></table>
    </td></tr></table>
    
    </body>
    </html>

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by chechu View Post
    Someone told me there where too many table tags in this code. How do I replace them using CSS ?
    It would be nice to know exactly how the document is supposed to appear. The attached image is what I see (albeit reduced to satisfy the forum software), which seems to have far too much empty space to be correct.

    Mike

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    The following are some links that describes the tableless layout using CSS

    From W3C
    Glish
    Davespicks
    CSS Drive - This one something similar to your requirement

  4. #4
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Thanks for the links. I will make the best of it.
    When you look at the screenshot, it looks weird indeed. But in the <iframe> where it appears, it looks fine ... Anyway, I'll give it a try.
    So in general: no more using tables and replacing all of them by css, or just with specific coding ?

Bookmarks

Posting Permissions

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