Solved

Table control and Screen Width

Posted on 1998-10-28
8
183 Views
Last Modified: 2010-04-09
I have a table that I would like to take up only the screen width if the screen size is set below 800x600. If it is 800x600 or greater I only want it to take up 800 pixels.

For example, If I view it with a screen size of 1024x768 I only want it to take up 800 pixels.

Is this possible and if so, how???

jeffrey
0
Comment
Question by:jkelly061597
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:chewymon
ID: 1839194
I don't think that it is possible in plain HTML.  You can use the percentage to fill the screen or the absolute to define the size.  You might be able to do it with a script that checks the display properties and uses if-then to define the tables.
0
 
LVL 4

Accepted Solution

by:
rafistern earned 200 total points
ID: 1839195
The following code works in NS3, NS4 and IE4. I haven't tested other browsers:

<BODY>
<img src="clear.gif" name="scrwid" width=100% height=1>
<script>
maxwidth=Math.min(document.images[0].width,800);
document.write("<table width="+maxwidth+">");
</script>
<noscript>
<table width=100%>
</noscript>
<tr>
<td>
some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text
</td>
</tr>
</table>


</BODY>

It even works when you resize the window (if you reload the document in Netscape).
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1839196
BTW for the theorists: is this DHTML in NS3??
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:jkelly061597
ID: 1839197
Great...

Can you do more for me?

Take a look at this page:
http://library.advanced.org/10867/search.shtml

Here is where I'm test implementing this. If you look at the page in IE, then take a look at it in NS you will see a major difference...

Is there any way to make them look more alike?
0
 

Author Comment

by:jkelly061597
ID: 1839198
Great...

Can you do more for me?

Take a look at this page:
http://library.advanced.org/10867/search.shtml

Here is where I'm test implementing this. If you look at the page in IE, then take a look at it in NS you will see a major difference...

Is there any way to make them look more alike?
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1839199
For Netscape it is not enough to state cellspacing=0. You need to add border=0. This will solve your problem.
0
 

Author Comment

by:jkelly061597
ID: 1839200
One more thing,

How can I get rid of the grey line across the screen in NS4?

Can I just make an image thats gray?

jeff
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1839201
Your problem appears to be that the title bar and the content are seperate tables. Do the following:

                  <img src="clear.gif" name="scrwid" width=100% height=1 BORDER=0 ALT="">
                  <script>
                        maxwidth=Math.min(document.images[0].width,800);
                        document.write("<table width="+maxwidth+" BGCOLOR=BLACK BORDER=0 CELLPADDING=0 CELLSPACING=0>");
                  </script>
                  <tr><td>
                  <TABLE WIDTH="100%" BGCOLOR="#000000" BORDER=0 CELLPADDING=0 CELLSPACING=1>
                 <TR><TD><A HREF="cgi-bin/stats/ax.cgi?http://home1.gte.net/mvmmvm/bor/"><IMG SRC="media/navbar/bor.gif" WIDTH=23 HEIGHT=24 ALT="" BORDER=0 ALIGN="RIGHT"></A>
<A HREF="home.shtml"><IMG SRC="media/navbar/home.gif" WIDTH=79 HEIGHT=21 ALT="" BORDER=0></A>
<A HREF="intro/index.shtml"><IMG SRC="media/navbar/intro.gif" WIDTH=48 HEIGHT=21 ALT="" BORDER="0"></A>
<A HREF="spill/index.shtml"><IMG SRC="media/navbar/spill.gif" WIDTH=67 HEIGHT=21 ALT="" BORDER="0"></A>
<A HREF="cleanup/index.shtml"><IMG SRC="media/navbar/cleanup.gif" WIDTH=89 HEIGHT=21 ALT="" BORDER="0"></A>
<A HREF="results/index.shtml"><IMG SRC="media/navbar/results.gif" WIDTH=86 HEIGHT=21 ALT="" BORDER="0"></A>
</TD></TR>
                  </TABLE>
      <TABLE WIDTH="100%" BGCOLOR=BLACK BORDER=0 CELLPADDING=10 CELLSPACING=1>
             <TR>
               <TD WIDTH=120 VALIGN="top" BGCOLOR="SILVER">
   
etc..

i.e. have one table containing the two. This seems to solve the problem.

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question