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 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="500" border="50" cellspacing="0" cellpadding="0"> + <img src="WidthTest.gif" width="400" height="200" style="border-width:0">
Because the border attribute creates borders both for TABLE and TD elements, the content width of the TD element is calculated in this case at the following way:
500-((2x50)+(2x1)) = 398. Because the image is wider than 398 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 = 502 pixel, which is wider than the calculated total width (500 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: 398 pixel ---
The right arrow

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