Consider the following definition of an HTML table.
<table> <tbody> <tr> <td rowspan='2'>A</td> <td>2</td> <td rowspan='2'>B</td> </tr> <tr> <td rowspan='2'>C</td> </tr> <tr> <td>1</td> <td>3</td> </tr> </tbody> </table>
I expect the table to look like this:
+---+---+---+ | A | 2 | B | | +---+ | | | C | | +---+ +---+ | 1 | | 3 | +---+---+---+
But in Firefox, IE8 and Chrome, the table is displayed as:
+---+---+---+ | A | 2 | B | +---+---+---+ | 1 | C | 3 | +---+---+---+
If I add another column to the column, like this:
<table> <tbody> <tr> <td>a</td> <td rowspan='2'>A</td> <td>2</td> <td rowspan='2'>B</td> </tr> <tr> <td>b</td> <td rowspan='2'>C</td> </tr> <tr> <td>c</td> <td>1</td> <td>3</td> </tr> </tbody> </table>
... I get the following, which is more like what I want.
+---+---+---+---+ | a | A | 2 | B | +---+ +---+ | | b | | C | | +---+---+ +---+ | c | 1 | | 3 | +---+---+---+---+
Questions:
Are browsers working properly? If so, why is the table not smoothing intuitively in the case of the first HTML segment indicated above?
Is there any valid HTML / css that will make the table render when I intend it?
source share