DelphiFAQ Home Search:
General :: Web publishing :: JavaScript
Code snippets to add functionality to your HTML pages, preferably cross-browser.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

How to create a table that takes up the full screen

Question:

I want to display something centered on the screen and figured I use a table with one row and one column and set ALIGN=CENTER and VALIGN=CENTER. But how can I force the browser to full screen and adjust the table?

Answer:

If your full screen window is popping up after a button or a link is clicked, then you can use javascript's window.open() as shown below.

If you need to resize an existing window, use the second piece of code. It will not hide the menu bar, status bar or other controls.

To make the table use the full window, simply put in WIDTH="100%" HEIGHT="100%" as shown at the bottom.

<script language="JavaScript" type="text/javascript">
 <!--
 
 // this opens a url in fullscreen mode
function fullscreen() {
 var w = window.open('http://www.coders-corner.com/','','fullscreen=yes');
 }
 
 // make an existing window full screen (for Internet Explorer)
var w = screen.width;
 var h = screen.height;
 resizeTo(w, h);
 moveTo(0, 0);
 
 // end hiding contents -->
</script>
 
 <table WIDTH="100%" HEIGHT="100%"><tr>

Generated 0:02:13 on Nov 18, 2018