This test case is for browsers, which support HTML 4.01 and the CSS2 separate borders model

[Back] [Test 0a] [Test 0b] [Test 0c] [Test 0d]
[Test 1] [Test 2] [Test 3] [Test 4]

Test 0a-0d test if the browser can handle the width attribute for the TABLE element correctly situations, where borders are given either with HTML or CSS. According to the HTML 4.01 specification the width attribute means the width of the entire table = the total width. Possible borders and paddings are calculated inside the width value of the TABLE element. The calculated content width is then subtracting borders and paddings from the total width. In order to show differences, I have used several values.


<TABLE width="475" style="border: 50px solid" cellspacing="0" cellpadding="0"> + <img src="WidthTest.gif" width="400" height="200" style="border-width:0">
Because the border property creates borders only for the TABLE element, the content width of the TD element is calculated in this case at the following way:
475-(2x50) = 375. Because the image is wider than 375 pixel the content width of the table can exceed so, that image fits inside the table.
The image below the table shows the correct width of the entire TABLE element = the total width of the table = 500 pixel, which is wider than the calculated total width (475 pixel), because the whole content must fit inside the table. The lower image shows the calculated value.


The left arrow --- the practical correct content width: 400 pixel ---
--- the calculated content width: 375 pixel ---
The right arrow

A content image
The practical correct total width of the table
The calculated correct total width of the table