Home
Home Page
Krossbrauzernoe alignment on the center (table height=100 %)
Lists a la MS Word
Features of links « upwards pages »
Tables and borders
We get rid from cellpadding and cellspacing
Optimum use MySQL
Competent job with files: exclusive blocking of files
How to learn{find out} the size of a file on any web - server
Regular expressions
Processing of lines in RNR
Creation of system of the account of visitings
Tracking a content on dynamic sites
CSS: advice{councils} and receptions, a part 2
CSS: advice{councils} and receptions, a part 1
Ten rules of a spelling of a safe code on PHP
About tags and metatags
Potential vulnerability of php-scripts
Removal{Distance} of a line from a file
The generator of passwords
Links
 

Krossbrauzernoe alignment on the center (table height=100 %)

From time to time me ask how to force to work the following code in Opera 7.0, and also in Internet Explorer 6 and Mozilla, when page in mode Standards compliance mode:



<table width = " 100 % " height = " 100 % ">

<tr>

<td align = "center"> the text which should settle down in the center of page </td>

</tr>

</table>


Why the text turns out prizhatym to the top border of the document instead of settling down in the center? First of all the matter is that in specification HTML 4.01 at tega table there is no attribute height, and consequently browsers in a mode of compatibility with standards (and Opera 7.0 in any case) ignore it . But the most interesting, that they cease to ignore it  if in CSS to specify the following design for extension of an outline of the document:



html, body {

height:100 %;

margin:0px;

padding:0px

}


Actually, you do not need to change something in itself HTML a code in which at you it is registered (perhaps for a long time when you and did not think, that height can sometime "cancel") height of the table.


Expecting questions, I want to make a pair of remarks under the resulted style description.


First, it is necessary to specify both elements html and body as it is simple body insufficiently. For example, for Mozilla in Standards compliance mode an outline is the element html, instead of body.


Second, if to clean{remove} zeroing margin and padding besides in a mode of compatibility with standards at page the unpleasant vertical strip of scrolling will appear.


Well and at last I want to note, that in any case the document in which contains teg table with attribute height, will not pass check. If to you will heat I oppress consciousness of that your documents valid, I advise to replace this attribute on CSS property height, not having forgotten, nevertheless, to specify in the table of styles the above mentioned decision for extension of an outline.