If you start writing a page with HTML5 's declaration now, you'll notice that the property is outdated or prompt for illegal properties when defining the cellspacing and cellpadding of the table. This is due to the fact that the two properties of the table tag have been removed in HTML5, and the CSS should be used when defining the border.
The specific implementation is as follows:
<!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head> <title>HTML5 Table Test</title> <styletype= "Text/css">Table{Border-collapse:collapse;Border:Solid 1px Black; }Table TD{width:50px;Height:20px;Border:Solid 1px Black;padding:5px;} </style></Head><Body> <Table> <TR> <TD></TD> <TD></TD> </TR> <TR> <TD></TD> <TD></TD> </TR> </Table></Body></HTML>
As follows:
The key point of the code is border-collapse:collapse; and Border:solid 1px Black;. For the definition of padding everyone is more familiar with, here is the main talk about the border-collapse in the collapse and separate values, defined as collapse, their borders will overlap together, When defined as separate, there is a gap between the cell borders. Defaults to separate when not defined. The separate case is as follows:
Code definition is very simple, is also the early version of the browser support things, but some of us used to use cellspacing and cellpadding to define, but these two properties will be removed in HTML5, so need to change to use CSS to define it. It's a simple thing, just a little bit of a note.
Note: In HTML5, many of the tag element's attributes are no longer present. The following are the core attributes and language attributes (with individual exceptions) that are common to each label in HTML5.
Class, Contenteditable, ContextMenu, dir, draggable, id, irrelevant, lang, ref, Registrationmark, TabIndex, template, titl E
Reprinted from: Http://xxling.com/article/76.aspx