Borde en tbody y td?

I have a table with a number of tbody's to group rows. I want border on each td to make a grid, but I also want border on the surrounding tbody to show that they are grouped. Is that possible?

http://jsfiddle.net/jyRsy/

preguntado el 31 de julio de 12 a las 15:07

3 Respuestas

Parece que la border propiedad en el tds is simply applied on top of the tbody's one :)

If you add at least 2px, not one - it will work. (http://jsfiddle.net/jyRsy/4/ - in this example - it's 3px.) I have tested this fiddle in all modern browsers. It works everywhere from IE8 on. As for IE7 - I'd not pay attention ;)

Respondido 31 Jul 12, 16:07

td { 
    border: 1px solid blue;
}

tbody {
    border: 2px solid red; 
}​

Respondido 31 Jul 12, 15:07

JS Fiddle. See http://jsfiddle.net/Dv4T6/

<table width="300">
    <thead>
        <tr>
            <th width="60" align="center" valign="top" scope="col">Type</th>
            <th width="200" align="left" valign="top" scope="col">Address</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td align="center" valign="top">Shipping</td>
            <td align="left" valign="top">123 Main St</td>
        </tr>
    </tbody>
</table>

Full browser and device support is not guaranteed.

Respondido 31 Jul 12, 15:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.