Solved

Table control and Screen Width

Posted on 1998-10-28
8
172 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spacing 5 56
SVG Logo 4 31
Bootstrap input box width 2 33
Jump to a specific point on a responsive page 5 27
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now