2012-08-01 4:38, John wrote:
Given this code:
table, th, td{
border:1px dotted black;
border-collapse:collapse;
}
I find that when I use colspan="x", some of the borders are solid as a result,
perhaps because they're doubled up as cells are widened by colspan.
1px dotted border has always been problematic, but this a new oddity. It
seems to be a bug in WebKit browsers (Chrome, Safari). At least my test,
http://www.cs.tut.fi/~jkorpela/test/coll.html, shows such a phenomenon
on them but not on other browsers. The markup in my test is
<table>
<tr><td>foo<td>bar<td>stuff1<td>more
<tr><td>hum<td colspan="2">spanning<td>more
<tr><td>foo<td>bar<td>stuff2<td>more
</table>
and on WebKit browsers, the border below stuff1 and above stuff2 is
solid, in default (100%) zoom. When the zoom is changed (e.g. with Ctrl
+), the border turns to dotted, then on new zooming to solid again.
Strange. Tested on Win 7. I took a screen capture and zoomed, and the
border is completely black, as opposite to letters, which exhibit color
variation due to subpixel rendering.
Is there a way around this, such that all the lines are 1px dotted black
regardless of how I use colspan?
A clumsy workaround, simulating collapsing borders with separate borders
(won't work on IE 6 due to lack of sufficient CSS support, so you might
add a "conditional comment" that switches to using your original code on
IE):
table {
border-collapse: separate;
border-spacing: 0;
}
th, td {
border: 1px dotted black;
border-top-width: 0;
border-left-width: 0;
}
tr:first-child > th, tr:first-child > td {
border-top-width: 1px;
}
th:first-child, td:first-child {
border-left-width: 1px;
}
(It just draws borders around each cell so the cells have no adjacent
borders.)
Yucca
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/