Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
Jump to content

Topic on VisualEditor/Feedback

How do you set the background color of a table cell?

7
2601:545:8201:6290:6C29:CD8C:7CC:9884 (talkcontribs)

The old method doesn't work anymore. How is it done now?

Whatamidoing (WMF) (talkcontribs)

This can't be done in the visual editor. You must do this in wikitext ("source") mode.

2601:545:8201:6290:6C29:CD8C:7CC:9884 (talkcontribs)

I was actually using the "source" mode. The existing coding to set background color no longer had an effect (background colors that used to show in the "old software" no longer do). I tried a few variations, but had no success. I then thought perhaps the visual editor would have a feature for it, probably being the "preferred mode", but there seemed to be none (as you've confirmed). I then thought I'd read the "User's Guide", and found nothing there, so I decided to "leave feedback" to ask about it (this here thread). Anyway, the old code, referencing a "standard color name", looked like this:

|width = "22px" bgcolor = "aquamarine" |

I thought perhaps "color names" were no longer recognized, so I tried substituting the equivalent hex: |width = "22px" bgcolor = "#7fffd4" |

still with no luck. I also tried it without the "#", still no luck. Then some other unsuccessful variation. Finally I figured i'd just come here and ''ASK'' how's it's done now. So then...how is it done now?

2601:545:8201:6290:6C29:CD8C:7CC:9884 (talkcontribs)

That is, how is it done now in "source mode", as the old code no longer works?

Whatamidoing (WMF) (talkcontribs)

Thanks for clarifying the question. If you search for the word background in https://en.wikipedia.org/wiki/Help:Table then you will find several examples. The old bgcolor approach isn't mentioned there, so it must have disappeared at some point.

2601:545:8201:6290:C59A:461:311B:8855 (talkcontribs)

THANK YOU! :) In summary, the old syntax bgcolor = "yellow" has been replaced with style = "background: yellow" such that with old source code containing the old form, a global-search-and-replace can be performed, replacing bgcolor = " with style = "background: (you may wish to include a SPACE at the end of the new text, but it is not required).

1957Harry (talkcontribs)

The old method does work, try this:

{| class="wikitable"

|-

!

! Functie

! Kleur

|-

| | D3

| | Warming(OCXO)

| bgcolor = "blue" |

|-

| | D4

| | LOCK

| bgcolor = "green" |

|}

Reply to "How do you set the background color of a table cell?"