www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to get my table on the top?

  1. #1
    Join Date
    Apr 2005
    Posts
    98

    How to get my table on the top?

    How can i get my table to align exactly along the top? With no empty space?

    Here is my code

    PHP Code:
    <html>
    <
    body background="test.jpg">

    <
    table border="1" width=750 height=600 align=center>
    <
    tr>
      <
    td>100</td>
    </
    tr>
    </
    table>

    </
    body>
    </
    html
    http://img215.imageshack.us/img215/1554/wd1yg.jpg

    here is a screenshot

    Thanks ahead of time

  2. #2
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,972
    And that kids, is why presentational HTML is just irritating.
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
      <head>
        <title>
          One big table.
        </title>
    <style type="text/css">
    <!--
    body{
      margin: 0;
      padding: 0;
      background: url(test.jpg) repeat green;
      text-align: center;
    }
    table#mrtable{
      width: 750px;
      height: 600px;
      text-align: center;
      table-layout: auto;
      margin: auto;
      border: 1px solid #555;
    }
    -->
    </style>
      </head>
      <body>
        <table id="mrtable">
          <tr>
            <td>
              foobar
            </td>
          </tr>
        </table>
      </body>
    </html>

  3. #3
    Join Date
    Apr 2005
    Posts
    98
    great thank you!

    what if i just want the table centered.. but not the text?

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    td { text-align: left }
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

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