Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it really bad idea to group tr tags with div?

Tags:

I'm developing application with Backbone.js View class returns one element after rendering. It's ok if I use divs or spans. But problem starts when I start to render objects as tr rows. One objects should be rendered to 2-3 rows. So can I use this structure?

<table>     <div>         <tr>...</tr>         <tr>...</tr>      </div> </table> 
like image 821
syabro Avatar asked Apr 21 '12 10:04

syabro


People also ask

Can I put div in TR?

No, you cannot insert a div directly inside of a table.

Is div allowed in TD?

One important thing to remember when putting a div inside of a table is that the div needs to live inside of a particular table cell, meaning inside of a td or th element which is inside of a tr element. This can help with using absolute positioning inside of table cells as well.

Can a table have 2 Tbody tags?

You may use more than one <tbody> per table as long as they are all consecutive.

Why do we use the TR tag >?

The <tr> HTML element defines a row of cells in a table. The row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements.


1 Answers

divs immediately inside a table tag is invalid. use tbody instead

like image 79
Gwyn Howell Avatar answered Sep 17 '22 10:09

Gwyn Howell