Testing for existence of implicit tbody (No DOCTYPE)

The following CSS was applied to the tables below:

table td { border: 1px solid blue; } table tbody td { border: 1px solid red; }

If the td elements in the tables below are bordered in blue, then they are not enclosed in a tbody. If they are border in red, then they are enclosed in a tbody.

No row groupings

test 1a test 1b test 1c
test 2a test 2b test 2c

thead used on first row

test 1a test 1b test 1c
test 2a test 2b test 2c

thead and tbody used

test 1a test 1b test 1c
test 2a test 2b test 2c