/    Sign up×
Community /Pin to ProfileBookmark

change color of a certain COL

is it possible to put in each col or row of a table in diffrent color?
thnaks in advance
peleg

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@johndoe190Jul 05.2004 — Why yes it is.

Just use css to handle it.

<style type="text/css">

.black {background:#000;}

.white {background:#FFF;}

</style>

then just add it to the rows or columns.

<td class="black"></td>
Copy linkTweet thisAlerts:
@pelegk1authorJul 06.2004 — [code=php]#000[/code]
6 digits/letter?
Copy linkTweet thisAlerts:
@DaveSWJul 06.2004 — you can condense them to three.

#000000 is the same as #000

#ffee00 is the same as #fe0

#990099 is the same as #909

etc.

You can only do it where the color code consists of repeated numbers/letters.
Copy linkTweet thisAlerts:
@pelegk1authorJul 11.2004 — do u mean by :
[code=php]You can only do it where the color code consists of repeated numbers/letters.[/code]
is
[code=php]#169564 [/code]
isnt good?
Copy linkTweet thisAlerts:
@Paul_JrJul 11.2004 — [code=php]
#FF0000 = #F00
#663333 = #633
#D0D0D0 = #D0D0D0
#3399CC = #39C
#83FED0 = #83FED0
#FFFFFF = #FFF
[/code]

[font=georgia]Most major graphics programs these days have an option to use only websafe colors (which is what these are) &#8212; in Photoshop, there is a checkbox in the lower left-hand corner of the pallete popup box.

You can see a whole list of them right <[url=http://hotwired.lycos.com/webmonkey/reference/color_codes/]here[/url]>[/font] (Of course, all those can be condensed into only using three of the six characters.)
Copy linkTweet thisAlerts:
@ray326Jul 11.2004 — It "isn't good" in the sense it "isn't web safe" but it's perfectly fine if web safe isn't an issue.
Copy linkTweet thisAlerts:
@pelegk1authorJul 21.2004 — but only when the colo defined for white or black it works

and in any other case it isnt!

[upl-file uuid=c2ee46df-b003-461f-9138-1486d1e6d87a size=283B]color2.zip[/upl-file]
Copy linkTweet thisAlerts:
@FangJul 22.2004 — color:red; is same as color:#ff0000; is same as color:#f00;

color:cornflowerblue; is same as color:#6495ed;

[B]Color of table columns and rows[/B]
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;Color table column and row&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;style type="text/css"&gt;
&lt;!--
td+td {color:red;}
td+td+td {color:cornflowerblue;}
td+td+td+td {color:#f00;}
td+td+td+td+td {color:#6495ed;}
tr.RowGreen&gt;td {color:green;}
/* <a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/">http://www.w3.org/TR/2001/CR-css3-selectors-20011113/</a> */
--&gt;
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;table&gt;
&lt;colgroup&gt;
&lt;col&gt;&lt;col style="color:cornflowerblue;"&gt;&lt;col style="color:red;"&gt;&lt;col style="color:#6495ed;"&gt;&lt;col style="color:#f00;"&gt;
&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="RowGreen" style="color:green;"&gt;
&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;&lt;td&gt;dfdsfasdf&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

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

For IE: use [URL=http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.2.4]colgroup and col[/URL] and for the row set the style in the tr.

For 'compliant' browsers use the css with class set in the tr.
×

Success!

Help @pelegk1 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 5.20,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...