Professional Documents
Culture Documents
A few examples. Padding is ommitted for clarity. See also the examples with alternative syntax.
Example 1
Example 2
The second example from the HTML3 spec. (interpreted from the ASCII graphics).
table { border-top: double; border-bottom: double; border-right: blank } thead, tbody, tfoot { border-top: solid; border-bottom: solid } colgroup { border-right: solid }
Example 3
Example 4
Example 5
NB1. 16 = 5 pixel border + 10 pixel spacing + 1 pixel shadow. Similarly, 12 = 10 px spacing + 2 shadows. NB2. It is convenient in this case to specify the ridge as 1,10,1, which sums to 12, but 2,20,2 would have given exactly the same result.
Example 6
prevent colgroup border */ prevent cell border */ thick } remove colgroup border */
This example is complicated because there is no way to address the part of the colgroup in the thead. It seems we would need a sort intersection operator for that. The problem has been solved in this case by setting the border on the whole colgroup and then removing it again in the tbody.
Example 7
In my notation:
table { border: 5px ridge(2,2,1) } td { border: 4px ridge /* implied: (1,2,1) */ }
Assuming that `thin' means 1px (not too unlikely), the table's border will be 2px shadow + 1px padding + 1px margin + 1 px shadow = 5px. Note that I also assume that shadow colors are chosen automatically.
Example 8
In my notation:
table { border: 5px ridge(2,2,1) } tr { border: 4px ridge }
Note that there are other ways of specifying the same. Instead of border on TR, one could have set top and bottom on each cell.
Example 9
In my notation:
table { border: 11px ridge(2,8,1) } td { border: 10px ridge(1,8,1) }
Example 10
In my notation:
table { border: 2px solid black } td { border: thin solid black }
Example 11
The shadow part seems to stick out, instead of being inside the border. That means it can overlap something else, but maybe that is a good thing... How about adding a transparency to the shadow? Here is an example style sheet:
table { border: thin dropshadow(thick) } td { border: thin dotted } #G { border: thin dropshadow(thick) override }
Cell G is assumed to have an ID `G'. The keyword `override' is used to make sure the cell's border style is honoured. If drop shadows are always `stronger' than dots, this keyword can be omitted.
Example 12
The color difference between the border and the cell is a problem. It can be solved in several ways: (1) in HTML, by putting the cell content inside another element, such as a P or DIV and putting a background on that, or (2) introducing a border-background property, or (3) specyfing that the table background is used for the border background. Solution 1 doesn't work if the child elements have unequal height. With solution 2 and 3, the dotted style needs the extra parameter that was already suggested earlier, to set the dot's diameter. Using solution 2 (set the yellow on child elements of the cells):
body { background: pink } table { border: none } td { border: 5pt green dotted(8pt,0.8) } td p { background: yellow }
Example 13
The problem here is the short red borders. It seems necessary to introduce the short rules as border types. Note that the endpoints of the rules are not aligned with the text, although that is more common in other tables. Also the white lines seem to go underneath the green dots, but this could be a general rule any time a solid line and a dotted line cross. An attempt using Dave's model:
table { rules: all; rule-style: dotted solid; rule-width: 5pt 2pt; rule-color: green white; /* How to suppress the rule below the thead? */ } thead td { border-style: none none solid none; border-width: thick; border-color: red; margin: 4pt; }
Example 14
Diagonal text and diagonal borders cannot be done without introducing some new property. Note that the cells are sheared 30, while the text is put vertically as well.
td { border: thin solid } thead { shear: -30 } thead td { text-rotation: 90 }
Example 15
There are several ways of looking at this table: (1) is is actually two tables instead of one, (2) there is space between the head and the body, (3) between the head and the body is a double line. Using 3 (and assuming the border background is taken from the table background):
tr { border: .4pt } table { border: thick solid } thead { border: 14pt double(1,12,1) } thead { background: cyan }
Example 16
Example 17
Single black border in the body, white (or transparent) borders in the head. (Actually, in the original, the blue parts weren't really aligned, they seemed to have been placed by an unsteady hand.)