What The Html 5 Alternative To Using The Rules Attribute For Table Element?
When using the rules attribute on this table element I get the following warning:
Solution 1:
What does
<table rules="">
do?Was used to specify the display of internal borders between rows and colums. This attribute has been deprecated. Use CSS to style table borders instead.
So there is no HTML5 alternative, just CSS alternative:
table {
border-collapse: collapse;
width: 100%;
margin-bottom: 15px;
}
tabletd {
text-align: center;
}
.frame-box {
border: 1px solid black;
}
.frame-void {
border: none;
}
.rules-nonetd {
border: none;
}
.rules-alltd {
border: 1px solid black;
}
.rules-alltd:first-child {
border-left: none;
}
.rules-alltd:last-child {
border-right: none;
}
.rules-alltr:first-child td {
border-top: none;
}
.rules-alltr:last-childtd {
border-bottom: none;
}
.rules-colstd {
border-left: 1px solid black;
border-right: 1px solid black;
}
.rules-rowstd {
border-top: 1px solid black;
border-bottom: 1px solid black;
}
.border-2,
.border-2td {
border-width: 2px;
}
"<TABLE BORDER=2 RULES=NONE FRAME=BOX>"
<tableclass="rules-none border-2 frame-box"><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr><tr><td>7</td><td>8</td><td>9</td></tr></table>
"<TABLE BORDER=2 FRAME=VOID RULES=ALL>"
<tableclass="border-2 frame-void rules-all"><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr><tr><td>7</td><td>8</td><td>9</td></tr></table>
"<TABLE BORDER=2 RULES=COLS FRAME=BOX>"
<tableclass="border-2 frame-box rules-cols"><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr><tr><td>7</td><td>8</td><td>9</td></tr></table>
"<TABLE BORDER=2 RULES=ROWS FRAME=BOX>"
<tableclass="border-2 frame-box rules-rows"><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr><tr><td>7</td><td>8</td><td>9</td></tr></table>
Solution 2:
HTML 5 demands that you replace the rules
attribute with CSS attributes.
Source: https://www.w3schools.com/tags/att_table_rules.asp
As A Row
I need your help, if the following code below counts every …
How To Make A Transition Effect Up The Input On Change
I need to place this particular effect on a dropdown I need…
Some Questions About Tree Construction [html Spec]
I know that it's not customary to ask a bunch of questi…
Post a Comment for "What The Html 5 Alternative To Using The Rules Attribute For Table Element?"