Is it necessary to have <tbody>
in every table? According to Standards.
Is it necessary to have in every table?
2019-02-07 17:28发布
相关问题
-
Can I use CSS3 with XHTML 1.0?
-
Is there an easy way to convert HTML with multiple
-
Disable back button while payment transaction occu
-
How to add target=_blank to all PDF links inside d
-
Why won't <iframe> elements validate in
查看全部
相关文章
-
X/Html Validator in PHP
-
What is this technique to resize the images propor
-
How widely supported is the iframe attribute “allo
-
How to mark the copyright of an image in html?
-
Simulating position: fixed in IE6 with a div of 10
-
W3C document states
-
Empty DIV height IE7
-
@font-face not working in Firefox?
查看全部
相关问题
- Can I use CSS3 with XHTML 1.0?
- Is there an easy way to convert HTML with multiple
- Disable back button while payment transaction occu
- How to add target=_blank to all PDF links inside d
- Why won't <iframe> elements validate in
相关文章
- X/Html Validator in PHP
- What is this technique to resize the images propor
- How widely supported is the iframe attribute “allo
- How to mark the copyright of an image in html?
- Simulating position: fixed in IE6 with a div of 10
- W3C document states
- Empty DIV height IE7
- @font-face not working in Firefox?
Most browsers are forgiving but even so I add the pair in all tables that I use now. Even trivial tables. Especially now that I'm using CSS more and more to decorate those tables.
All that being said I have old tables that still work fine on the newest browsers. I'm learning the hard way but taking the few extra Micro seconds to add the optional tags here and there ends up saving you money/time in the long run.
Dave
Only if you define
thead
andtfoot
. It is mostly used when the table has multiple bodies of content. If the data in the table is easily understood to be thetbody
then you can safely omit it.For the small fraction of your users still using IE7, you MUST add encapsulate your tr's in a tbody tag if you're building a table with the DOM methods!
This will work in all major browsers:
This will NOT work in IE7:
A quick blog post of mine on building tables:
http://blog.svidgen.com/2012/05/building-tables-in-ie7-with-javascript.html
It may be notable that I no longer make the effort to support IE7 on my own projects. The IE<=7 share is likely negligible for most sites at this point.
Quoting the HTML 4 spec: "The TBODY start tag is always required except when the table contains only one table body and no table head or foot sections. The TBODY end tag may always be safely omitted."
So, you must have a
<tbody>
tag if you have a<thead>
or<tfoot>
See also: MDN