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="500" 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 at this case the following way:
500-(2x50) = 400, which means that it should be exactly as wide as the image.
The image below the table shows the correct width of the entire TABLE element = the total width of the table = 500 pixel.


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

A content image
The correct total width of the table