Kompx.com or Compmiscellanea.com

HTML centering

Windows : Internet Explorer 3.0+, Firefox 1.0+, Google Chrome, Opera 3.51 - 6.xx and 9.0+, Safari 3.1+, SeaMonkey 1.0+ [ 1 ].

Linux : Firefox 1.0+, Chromium, Opera 5.0 - 6.xx and 9.0+, SeaMonkey 1.0+ [ 2 ].

Centering the whole content of a web page in the viewable area of a browser by pure HTML - no CSS. A box to keep the content of the page is HTML centered horizontally and vertically - [ Open demo page ]

HTML. Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>HTML centering</title>

<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">

</head>

<body bgcolor="#ffffff">

<table width="100%" height="100%" bgcolor="#a3ddc4">

<tr>

<td align="center">

<table width="800" height="500" bgcolor="#ff6f6f">

<tr>

<td>&nbsp;</td>

</tr>

</table>

</td>

</tr>

</table>

</body>

</html>

The outer HTML table makes the whole web browser viewable area, except margins, a HTML table and the whole area of this HTML table - a HTML table cell.

The cell of the outer HTML table inherits the default value for valign attribute from its parent table row. And this row in its turn inherits the default value for valign attribute from the outer HTML table tbody - even if tbody tag is not used. And that value is middle. So a block of content inside the cell of the outer HTML table is centered vertically in web browser viewable are.

Align="center" of the outer HTML table cell makes a block of content inside it centered horizontally in web browser viewable are.

The inner table, the one inside of the outer HTML table cell makes up a box of a given size. Or there may be no set height or no set width or both. Then the size of the box is to adjust to accommodate the content, whatever its dimensions are. If the width or height or both of the box results to be larger than web browser viewable area, then it still ends up to be centered.

Since HTML centering is the oldest method to center content horizontally and vertically, it works well not just in older web browsers, but in ones that can be described as downright ancient. Like adding one more HTML tag ( <center></center> ) around the outer table makes it funcion as deep as Internet Explorer 3 : [ Open demo page ]

Download Internet Explorer 3: a pack, containing 3.0, 4.01, 5.01, 5.5, 6.0 versions of Internet Explorer

HTML. Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>HTML centering for Internet Explorer 3</title>

<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">

</head>

<body bgcolor="#ffffff">

<!-- For Internet Explorer 3 --><center><!-- For Internet Explorer 3 -->

<table width="100%" height="100%" bgcolor="#a3ddc4">

<tr>

<td align="center">

<table width="800" height="500" bgcolor="#ff6f6f">

<tr>

<td>&nbsp;</td>

</tr>

</table>

</td>

</tr>

</table>

<!-- For Internet Explorer 3 --><center><!-- For Internet Explorer 3 -->

</body>

</html>

HTML horizontal and vertical centering of a box containing web page content has become obsolescent as a result of semantic markup spread. But it is still reliable. Not only in the major and modern web browsers, but in many alternative and older ones as well.

There is a minor flaw in it though. The height attribute of the <table><table/> tag is used there. It is supported for years by the majority of web browsers, but is incompatible with the standards promoted by World Wide Web Consortium (W3C). So the code does not pass W3C validation. Back in 1990s - early 2000s, it was complicated or impossible to succeed in making a code both valid and working in the majority of web browsers, so the flaw was not looked at as a real problem.


[ 1 ]

As well as Netscape 2.02 - 4.80 and Offbyone. There is some shift of page content to the top left corner of the web browser viewable area in Netscape 2.02 - 4.80, since these web browsers reserve the place for scrollbars.

[ 2 ]

As well as Netscape 2.02 - 4.80. There is some shift of page content to the top left corner of the web browser viewable area in Netscape 2.02 - 4.80, since these web browsers reserve the place for scrollbars.


Aliosque subditos et thema

 

Imapsync IMAP migration under Windows

 

Migrating an IMAP e-mail box from one IMAP server to another under Windows [ 1 ] [ 2 ] by means of imapsync: Copying an e-mail box with all its contents and keeping its folder structure; The e-mail box is hosted at a web hosting company's server and transfered to a common Yandex Mail (not Yandex Mail for Domain); Both IMAP servers support SSL. The process is done in three steps: test run, migrating folder structure, migrating e-mails. Test run Content of imapsync-test.bat: .\imapsync.exe ^ --host1 imap.domain.ru --user1 email1@domain.ru --password1 "password1" ^ --host2 imap.yandex.ru --user2 email2@yandex.ru --password2 "password2" ^ --ssl1 --ssl2 --sslargs1 SSL_verify_mode=0 --sslargs2 SSL_verify_mode=1 ^ --skipheader "^(?!Message-Id)" ^ --automap ^ --regextrans2 "s/^INBOX\.(.+)/$1/" ^ --addheader ^ --justfolders ^ --dry @PAUSE Note: the caret character ( ^ ) at the end of line means "this command continues on the next line". It allows to break long command with many options into several parts to put them in several lines for better readability. This step is meant for testing if imapsync may be run at all, if it can connect to both e-mail boxes and can read the basic structure of the first one. Imapsync runs without actually doing anything, just printing what would have been done without the --dry option. Adding --justfolders is to make testing faster, as imapsync does its job only for folders then. A log file with full details for each run is placed into the LOG_imapsync folder. Migrating folder structure Content of imapsync-folders.bat: .\imapsync.exe ^ --host1 imap.domain.ru --user1 email1@domain.ru --password1 "password1" ^ --host2 imap.yandex.ru --user2 email2@yandex.ru --password2 "password2" ^ --ssl1 --ssl2 --sslargs1 SSL_verify_mode=0 --sslargs2 SSL_verify_mode=1 ^ --skipheader "^(?!Message-Id)" ^ --automap ^ --regextrans2 "s/^INBOX\.(.+)/$1/" ^ --addheader ^ --justfolders @PAUSE This step reproduces the folder structure of the e-mail box being migrated in the one it is being migrated to. Migrating e-mails Content of imapsync-emails.bat: .\imapsync.exe ^ --host1 imap.domain.ru --user1 email1@domain.ru --password1 "password1" ^ --host2 imap.yandex.ru --user2 email2@yandex.ru --password2 "password2" ^ --ssl1 --ssl2 --sslargs1 SSL_verify_mode=0 --sslargs2 SSL_verify_mode=1 ^ --skipheader "^(?!Message-Id)" ^ --automap ^ --regextrans2 "s/^INBOX\.(.+)/$1/" ^ --addheader @PAUSE Now e-mails are being copied.

Selecting all in mc

 

Selecting all files and folders in a directory viewed in a panel of Midnight Commander. Achieving the same effect a does Ctrl - A under Microsoft Windows or Cmd - A in Mac OS X: Open a directory --> Ctrl - Shift - = --> Enter * [asterisk] --> Enter A directory with files and folders Selection options prompt Entering * [asterisk] All files and folders has been selected The keyboard shortcut of Ctrl - Shift - = is meant to type plus symbol. So just Shift - = may also happen to be enough. The "Using shell patterns" option in selection options prompt has to be checked on in order to make asterisk to work as the symbol for "all" or "any".