dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: style tag for table row

  1. #1
    Join Date
    Jun 2005
    Posts
    5

    style tag for table row

    hi..
    i have a html code where i am specifiying the style for the table row

    the code goes like this

    <html>

    <body>

    <table>
    <tr style="position:absolute; left: 100px; top: 100px;" >
    <td>
    val
    </td>
    </tr>
    </table>

    </body>
    </html>



    this works fine in internet explorer and mozilla firefox

    but in netscape it is not working what could be the reason for this

    thanks in advance

    zeta

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,604
    Maybe your example was a greatly simplified version, but wouldn't it be much simpler (and more semantically correct) to just do:
    HTML Code:
    <html>
    <body>
    <p style="position:absolute; left: 100px; top: 100px;" >
    val
    </p>
    </body>
    </html>
    Or, even cleaner:
    HTML Code:
    <html>
    <style type="text/css">
    body {
      margin: 0;
      padding: 0;
    }
    #myid {
      margin-top: 100px;
      margin-left: 100px;
    }
    </style>
    <body>
    <p id=myid>val</p>
    </body>
    </html>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,604
    Oh, and if you want it to validate correctly:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang='en'>
    <head>
    <META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
    <title>Page title</title>
    <style type="text/css">
    <!--
    body {
      margin: 0;
      padding: 0;
    }
    #myid {
      margin-top: 100px;
      margin-left: 100px;
    }
    -->
    </style>
    </head>
    <body>
    <p id=myid>val</p>
    </body>
    </html>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Jun 2005
    Posts
    5
    this might work but i need to try it wilth table row itself

    this is because i am using jsp datatable and i need to set style tag for each row in the data table

  5. #5
    Join Date
    Jun 2005
    Posts
    5

    table row style

    this might work but i need to try it wilth table row itself

    this is because i am using jsp datatable and i need to set style tag for each row in the data table

  6. #6
    Join Date
    Jun 2005
    Posts
    5
    this might work but i need to try it wilth table row itself

    this is because i am using jsp datatable and i need to set style tag for each row in the data table

  7. #7
    Join Date
    Jan 2005
    Location
    Lithia Springs, GA USA
    Posts
    886
    so make it a class and apply the class to the tr tag

    Instead of using # use .

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
     <html lang='en'>
     <head>
     <META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
     <title>Page title</title>
     <style type="text/css">
     <!--
     body { margin: 0; padding: 0; }
     .myclass { margin-top: 100px; margin-left: 100px; }
     -->
     </style>
     </head>
     <body>
         <tr class="myclass">
            <td>some content</td>
         </tr>
     </body>
    </html>
    Last edited by BeachSide; 07-02-2005 at 05:46 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles