Can we name html <table>?
name not a valid <table> attribute in HTML5. From the thin specification :
Allowed Attributes
global attributes and boundaries
And if you look at global attributes , you will not find name in the list.
Therefore, you cannot put the name attribute in <table> and still have valid HTML. id , however, is a global attribute, so you can use it instead of name (unless, of course, your name is unique on the page).
Try the following:
<!DOCTYPE html> <head><title>t</title></head> <body> <table name="pancakes"></table> </body> through http://validator.w3.org , and you will see that he does not like the name on <table> .
If you are still writing HTML4, you still cannot put the name attribute on the <table> . From the thin specification :
<!ATTLIST TABLE -- table element -- %attrs; -- %coreattrs, %i18n, %events -- summary %Text; #IMPLIED -- purpose/structure for speech output-- width %Length; #IMPLIED -- table width -- border %Pixels; #IMPLIED -- controls frame width around table -- frame %TFrame; #IMPLIED -- which parts of frame to render -- rules %TRules; #IMPLIED -- rulings between rows and cols -- cellspacing %Length; #IMPLIED -- spacing between cells -- cellpadding %Length; #IMPLIED -- spacing within cells -- > There is no name in this list and no name in coreattrs , i18n or events .
No dude, you cannot assign a name to a table element.
For a table, you can specify an identifier or attribute of a class that refers to a specific table in your HTML code, and then based on this, you can make changes to the table through CSS, javascript, jquery, etc.
Hope this information helps ...!