Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a html table within a table valid?

Tags:

html

In html, is it valid to have a table inside of a table?

<table>   <tr>     <td>       <table>         <tr>           <td></td>         </tr>       </table>     </td>   </tr>   <tr></tr> </table>  
like image 414
Bill Avatar asked Mar 19 '12 01:03

Bill


People also ask

Can you have a table within a table HTML?

HTML supports this functionality and is known as the nesting of the tables. Tables can be nested together to create a table inside a table. To create a nested table, we need to create a table using the <table> tag. This table is known as the outer table.

Can I have a table inside a table?

A table can be created within another table by simply using the table tags like <table>, <tr>, <td>, etc., to create our nested table. Since nesting tables can lead to higher complexity levels, remember to begin and end the nesting tables within the same cell.

Is HTML table outdated?

table tag isn't deprecated (you can look at the html spec). What you've heard of is probably tableless layouts, because tables should not be used for positioning elements on the page.

Should I avoid HTML table?

The HTML 4 specification states: "Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media." So, if you want to write valid HTML 4.01, you can't use tables for layout.


1 Answers

Yes, perfectly valid.

By pasting what you have into the W3C validator, the only errors are regarding doctype, head tags, etc... nothing ever mentioned of nesting table within table (even after adding all the correct tags that it errored on) It suggests using a tbody

http://validator.w3.org/check

like image 107
Anthony Shaw Avatar answered Sep 23 '22 01:09

Anthony Shaw