views:

55

answers:

2
table td+td+td+td+td+td{
    display:table-cell;
}

What does + mean?

+1  A: 

Adjacent sibling selector.

Thus, the following rule states that when a P element immediately follows a MATH element, it should not be indented: math + p { text-indent: 0 }

http://www.w3.org/TR/CSS2/selector.html#adjacent-selectors

meder
Is it IE only ?
COMer
It's standard. Not supported in IE6/IE7... maybe in 8+
meder
@COMer: It's non-IE only. At least according to [quirksmode](http://quirksmode.org/css/contents.html#t12). IE7 and IE8 seems to have _some_ support though, IE9 seems to support it fully.
Georg
+4  A: 

It is the adjacent sibling selector.

So if you have sth. like:

<table> 
    <tr>
        <td></td> <!-- starting from here A-->
        <td></td> <!-- starting from here B-->
        <td></td>
        <td></td>
        <td></td>
        <td></td> <!-- selects this one A -->
        <td></td> <!-- selects this one B -->
    </tr>
</table>

So the last two cells in this example will be selected. See here: http://jsfiddle.net/ERkEk/

The whole CSS selector seems not very useful to me (personal opinion) like hardcoding to me. It might be necessary in some cases, but it is harder to maintain than using classes. You very much rely on the markup in this case.

Update: It is supported in all browsers but IE 5.5 and IE 6 and is not 100% supported in IE <= 8.

Felix Kling
Actually it can be extremely useful when dealing with markup you dont control when you need to get at a certain element like a `td` that doesnt have a class or id.
prodigitalson
Is it IE only ?
COMer
@prodigitalson: Yes, I agree, if you don't have control over the markup then this is probably the only way. But this is kinda hardcoding and if the markup changes you might have to change the CSS too.
Felix Kling
It also selects the last `td` in your example row. As long as the cell is preceded by five other cells, it will be selected by that selector. As for its usefulness, if the preceding five `td` elements are not displayed as table-cell, it can be a way to create a row of cells below other data areas that are displayed full-width (essentially giving the same effect as nested tables in old-school tag soup).
Stan Rogers