Solved

Table control and Screen Width

Posted on 1998-10-28
8
161 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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)

705 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

20 Experts available now in Live!

Get 1:1 Help Now