September 15, 1997
DR. WEBSITE: How To Make Sites Open With No Toolbar or Menu Bar; Making Colored
Borders for Tables
By David Fiedler and Scott Clark
Dear Dr. Website: How do people write their HTML code so that when others visit their
sites, their menu bar, the location box, and the status bar have "disappeared"?
What they are usually doing is opening a new window from a hyperlink. You can use a
JavaScript function to open a window with no toolbars, menubars, or other related devices,
like this:
<SCRIPT LANGUAGE="Java Script">
<!--//
function openit(sURL){
newwindow=open(sURL,"newwin","scrollbars=no, toolbar=no, directories=no, menu
bar=no, resizable=yes, status=yes, width=600, height=500");
}
//-->
</SCRIPT>
</head>
<body>
Then, when you want the link to the page, you call the function by enclosing the name of
the page that you wish to open in the function's parentheses, like this:
<A HREF="javascript:openit ('clicktext.html')">open window with no toolbars</A>
If you wish to open this new window when the page first appears, call the function from
the onLoad event in the BODY tag of the hyperlinked page, such as in this example:
<BODY onLoad="openit ('clicktest')">
At the bottom of the openit( ) function, you can include the following code:
window.history.go(-1);
This will cause the new window to open, and the old window to go back by one page in its
history, so that it appears that the hyperlink just opened the new window, even if you are
linked from someone else's site.
The JavaScript code would be the only code on the page that is initially called, with the
newly opened browser window containing the actual linked page.
Table Tricks
Dear Dr. Website: Is there an easy way to create a border around a table? I do not want to
see the grid lines inside the table. In essence, I want to create a columnar format without
grid lines, but with a border around all the columns on the outside only.
The only way I can think of to do this is to create the table with an extra row and column
around the data and then apply a color to all the outside cells. Is this the only way? It has to
work in Netscape 3.0.
The easiest way to create a border around a table is to create a table within a table. The outer
table is only a few pixels larger than the inner table, and the outer table's background color
provides your border color. For example:
<TABLE WIDTH=400 HEIGHT=29 BGCOLOR="#FFFF00">
<TD>
<TABLE BORDER=1 BGCOLOR="#000000" WIDTH=398 HEIGHT=27>
<TR VALIGN=TOP HALIGN=CENTER>
<TD><CENTER>
<FONT COLOR="white">This is a test.
If this were not a test, you would be looking at something that actually means something.
You're not.</FONT>
</CENTER>
</TD></TABLE>
</TD></TABLE>
This way your border size and color can be adjusted. The inner table will stay the same as it
was previously.
RELATED STORIES:
Webdeveloper.com's home page
Back to Home Page
Keywords:
html, design
Date:
19970922