Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table widths

Status
Not open for further replies.

WJProctor

Programmer
Jun 20, 2003
151
GB
Im a bit confused and wondered if someone could clarify this for me.

If i set a table to have a width of 80% then do the widths of the colums add up to 80% or 100%. Eg if i wanted to have 2 colums both the same width in an 80% table would i specify their widths as 40% or 50%.

Cheers

JP
 
Ive actually worked out that is would the 50% of 80% and so on. My problem still remains that if i set the table size to 80% it looks great in 1024 X 800 res but if i drop it to 800 x 600 then its no longer 80% of the screen its like 110% cos i need to scroll across to see all of the page. Whys this and how can i change it.

JP
 
Code:
<html>
  <head>
  </head>
  <body>
    <table border=&quot;1&quot; width=&quot;50%&quot;>
      <tr>
        <td width=&quot;50%&quot;>clearly not...</td>
        <td width=&quot;50%&quot;>...half the <em>screen</em>.</td>
      </tr>
    </table>
  </body>
</html>

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Whys this and how can i change it.

It is probably because you are trying too hard to make a web page something else. This is not a problem if you are writing a web page. This is only a problem if you are making a printed document that you want to show through a browser or a TV program you want to show through a browser, etc.

There are many threads about trying to force the Users browser to show your page the way you want.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Well why isnt 80% of a high res 80% of a low res. Its strange. Maybe summot daft im doing. Is there anything important that i should know. Im using ColSpan. would that effect it at all.
 
&quot;res&quot; is an irrelevant term for the web.

If you set your table to 80%, then it will spread to 80% of the width of the browser window. This is only peripherally related to the width of the screen, by the way. For example, right now, is your browser set to full-screen? I'll bet it isn't. [smile]

What sort of content are you shoving into a table? They're only designed to hold tabular type of data, such as numbers or columns of things.

Make my example above a file on your local machine and see how it functions as you change the size of the browser window. The 50% doesn't change through some pretty rigorous twanglings of the window.

When you make a table, it's smart to make a blank table first, with a border of &quot;1&quot; and then see how it'll look before you populate the heck out of it.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top