/    Sign up×
Community /Pin to ProfileBookmark

They Deprecated in Html 5 ?

Hi,

Got Fire Fox v101.01.
This working fine:

[code]
<table border=”10″ cellspacing=”5″ cellpadding=”20″ bordercolor = “red” bgcolor = “white”>
[/code]

But I read they deprecated in html 5. So, how they working here ? Should I ignore them or not ?
Talking out:
bgcolor
background

Is bordercolor, caption, colgroup deprecated ?

to post a comment
HTML

17 Comments(s)

Copy linkTweet thisAlerts:
@novice2022authorJun 22.2022 — Hi,

This shows first two cols on left s red:
<i>
</i>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;The colgroup element&lt;/h1&gt;

&lt;table&gt;
&lt;colgroup&gt;
&lt;col span="2" style="background-color:red"&gt;
&lt;col style="background-color:yellow"&gt;
&lt;/colgroup&gt;
&lt;tr&gt;
&lt;th&gt;ISBN&lt;/th&gt;
&lt;th&gt;Title&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3476896&lt;/td&gt;
&lt;td&gt;My first HTML&lt;/td&gt;
&lt;td&gt;$53&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5869207&lt;/td&gt;
&lt;td&gt;My first CSS&lt;/td&gt;
&lt;td&gt;$49&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;


Now, how do I get the colour to change every sec from red to green, green to blue. Then blue to red again. Then, repeat the colour loop.

Change colours every sec. The cell background colours, I mean.
Copy linkTweet thisAlerts:
@ginerjmJun 22.2022 — CSS. And a loop for each row's output code
Copy linkTweet thisAlerts:
@NogDogJun 22.2022 — Note that by definition, "deprecated" does not mean "not supported" -- it means that at some point in the future it will not be supported; so it's a warning that you should stop using it now so that it doesn't break later.
Copy linkTweet thisAlerts:
@novice2022authorJun 22.2022 — @NogDog#1644806

Ok. Thanks.

Out of these, which one you know, are deprecated ....

bgcolor

background

bordercolor

caption

colgroup
Copy linkTweet thisAlerts:
@novice2022authorJun 22.2022 — @ginerjm#1644805

With pure html5 only. How to do ?
Copy linkTweet thisAlerts:
@NogDogJun 22.2022 — > @novice2022#1644808 With pure html5 only. How to do ?

[code=html]
<td style="background-color: #336699;color: white;">
[/code]
Copy linkTweet thisAlerts:
@cootheadJun 22.2022 — > @novice2022#1644808

> With pure html5 only. How to do ?


Like this perhaps...
<i>
</i>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en"&gt;
&lt;head&gt;

&lt;meta charset="utf-8"&gt;
&lt;meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"&gt;

&lt;title&gt;The tr element&lt;/title&gt;

&lt;link rel="stylesheet" href="screen.css" media="screen"&gt;

&lt;style media="screen"&gt;
body {
background-color: #f9f9f9;
font: normal 1em / 1.5em sans-serif;
}
th, td {
padding: 0.5em 0.75em;
}
tr th:nth-of-type(1),
tr th:nth-of-type(2),
tr td:nth-of-type(1),
tr td:nth-of-type(2) {
background-color:#f00;
animation: colorchange 9s ease-in-out infinite;
}
tr th:nth-of-type(3),
tr td:nth-of-type(3) {
background-color:#ff0;
}
@keyframes colorchange {
0% {
background-color:#f00;
} <br/>
33.3% {
background-color:#090;
color: #fff;
}
66.6% {
background-color:#00f;
color: #fff;
}
}
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;The tr element&lt;/h1&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope="col"&gt;ISBN&lt;/th&gt;
&lt;th scope="col"&gt;Title&lt;/th&gt;
&lt;th scope="col"&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3476896&lt;/td&gt;
&lt;td&gt;My first HTML&lt;/td&gt;
&lt;td&gt;$53&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5869207&lt;/td&gt;
&lt;td&gt;My first CSS&lt;/td&gt;
&lt;td&gt;$49&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;


[i]coothead[/i]
Copy linkTweet thisAlerts:
@novice2022authorJun 22.2022 — @coothead#1644812

That is very very cool. Indeed!

More than I expected.

However, are you sure it's not css and pure html 5 ?

I am trying to memorise the code. memorising html5 not that hard but css is. I new at css. Basic level.
Copy linkTweet thisAlerts:
@NogDogJun 22.2022 — > @novice2022#1644815 sure it's not css and pure html 5

It's 2022. If you want to control how browsers display your HTML, use CSS. Period.
Copy linkTweet thisAlerts:
@SempervivumJun 23.2022 — @novice2022#1644800
>Is bordercolor, caption, colgroup deprecated ?


>Out of these, which one you know, are deprecated ....

bgcolor

background

bordercolor

caption

colgroup


This site will tell you exactly:

https://validator.w3.org
Copy linkTweet thisAlerts:
@novice2022authorJun 23.2022 — @Sempervivum#1644818

But I do not have a website. Working on localhost.

Now what ?

EDIT:

Ok. Found it:

https://validator.w3.org/#validate_by_input+with_options
Copy linkTweet thisAlerts:
@SempervivumJun 23.2022 — Fine. You have to provide a complete document for checking, including doctype, html, head, etc.

Snippets will not work.
Copy linkTweet thisAlerts:
@novice2022authorJun 23.2022 — @Sempervivum#1644831

I did provide a complete code.

But, it does not detect this line is incorrect:
<i>
</i>#gt0-#gt2:hover {background-color: orange; color: red;}

Nor suggests any correction, which I was expecting. That is my big issue. WHich I need help here:

https://forum.webdeveloper.com/d/400062-how-to-change-text-colour-in-a-table-via-colgroup/8

See for yourself on this link:

https://validator.w3.org/nu/#textarea

Here is the full code I am testing:
<i>
</i>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Table&lt;/title&gt;
&lt;style&gt;

th:hover {background-color: black; color: gold;}
tr:hover {background-color: silver; color: white;}

#gt0-#gt2:hover {background-color: orange; color: red;}

&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;table border="20" width="100%" cellspacing="5" cellpadding="20" color="red" bgcolor="orange"&gt;
&lt;caption&gt;Caption&lt;/caption&gt;
&lt;colgroup&gt;
&lt;col span="3" style="background-color:white; color:green; font-family:courier; font-size:50%"&gt;
&lt;col span="3" style="background-color:black; color:blue; font-family:verdana; font-size:40%"&gt;
&lt;col span="3" style="color:red; font-family:arial; font-size:10%"&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th colspan="3"&gt;GOOD&lt;/th&gt;&lt;th colspan="3"&gt;BAD&lt;/th&gt;&lt;th colspan="3"&gt;NEUTRAL&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Title&lt;/td&gt;&lt;td&gt;FIRST NAME&lt;/td&gt;&lt;td&gt;SURNAME&lt;/td&gt;&lt;td&gt;Title&lt;/td&gt;&lt;td&gt;FIRST NAME&lt;/td&gt;&lt;td&gt;SURNAME&lt;/td&gt;&lt;td&gt;Title&lt;/td&gt;&lt;td&gt;FIRST NAME&lt;/td&gt;&lt;td&gt;SURNAME&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="gt0"&gt;Mr&lt;/td&gt;&lt;td id="gf0"&gt;Muhammad&lt;/td&gt;&lt;td id="gs0"&gt;Ali&lt;/td&gt;&lt;td id="bt0"&gt;Mr&lt;/td&gt;&lt;td id="bf0"&gt;Adolph&lt;/td&gt;&lt;td id="bs0"&gt;Hitler&lt;/td&gt;&lt;td id="nt0"&gt;Mr&lt;/td&gt;&lt;td id="nf0"&gt;Mohandas&lt;/td&gt;&lt;td id="ns0"&gt;Ghandi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="gt1"&gt;Mr&lt;/td&gt;&lt;td id="gf1"&gt;Mike&lt;/td&gt;&lt;td id="gs1"&gt;Tyson&lt;/td&gt;&lt;td id="bt1"&gt;Mr&lt;/td&gt;&lt;td id="bf1"&gt;Winston&lt;/td&gt;&lt;td id="bs1"&gt;Churchill&lt;/td&gt;&lt;td id="nt1"&gt;Mr&lt;/td&gt;&lt;td id="nf1"&gt;Crocodile&lt;/td&gt;&lt;td id="ns1"&gt;Dundee&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td id="gt2"&gt;Mr&lt;/td&gt;&lt;td id="gf2"&gt;Malcolm&lt;/td&gt;&lt;td id="gs2"&gt;X&lt;/td&gt;&lt;td id="bt2"&gt;Mr&lt;/td&gt;&lt;td id="bf2"&gt;Joseph&lt;/td&gt;&lt;td id="bs2"&gt;Stalin&lt;/td&gt;&lt;td id="nt2"&gt;Mr&lt;/td&gt;&lt;td id="nf2"&gt;Napolean&lt;/td&gt;&lt;td id="ns2"&gt;Bonaparte&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;tfoot&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;GOOD&lt;/td&gt;&lt;td colspan="3"&gt;BAD&lt;/td&gt;&lt;td colspan="3"&gt;NEUTRAL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tfoot&gt;
&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;


@coothead

Why is that ?
Copy linkTweet thisAlerts:
@SempervivumJun 23.2022 — @novice2022#1644832

I see. The validator detects syntax errors only. And from the view of syntax it considers `#gt0-#gt2</C> as a valid selector, although I'm a bit surprised that <C>#` is permitted inside a selector. I would have expected that it's reserved as it's the leading character for an ID.

However from the view of semantics or logic it makes no sense as there is no element in the HTML matching.
Copy linkTweet thisAlerts:
@novice2022authorJun 23.2022 — @Sempervivum#1644837

Mmm.

Still scratching my head.

It seems I cannot shorten it then to make it work on my two browsers and would have to stick to the longest way ...
<i>
</i>#gt0:hover {background-color: orange; color: red;}
#gt1:hover {background-color: orange; color: red;}
#gt2:hover {background-color: orange; color: red;}


Let's continue this issue here:

https://forum.webdeveloper.com/d/400062-how-to-change-text-colour-in-a-table-via-colgroup/10
Copy linkTweet thisAlerts:
@novice2022authorJun 23.2022 — @Sempervivum#1644837

Do close this thread.

Thanks!
Copy linkTweet thisAlerts:
@SempervivumJun 23.2022 — {"locked":true}
×

Success!

Help @novice2022 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 3.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,

tipper: Anonymous,
tipped: article
amount: 10 SATS,
)...