Wikiwand AI

Help talk:Table

From Wikipedia, the free encyclopedia

Colors

Hi all, it took me quite some effort to determine how to change background color of a cell or complete table. It appears that one cannot use html color coding, like f3f3f3, but one should use (in this case), background-color:WhiteSmoke. Can this be added to the page, including a list to a conversion from html into these textual codes? I wanted to use the background color of an image for the complete table. Thanks, Ellywa (talk) 15:54, 18 December 2025 (UTC)

It's working for me. For all table cells, or a single table cell.
I am viewing in dark mode.
style=background-color:#f3f3f3;
More information Header text ...
Caption text
Header textHeader textHeader text
ExampleExampleExample
ExampleExampletest
ExampleExampleExample
Close
More information Header text ...
Caption text
Header textHeader textHeader text
ExampleExampleExample
ExampleExampleExample
ExampleExampleExample
Close
I wonder where the "caption text" disappeared to in the 2nd table.
--Timeshifter (talk) 17:17, 18 December 2025 (UTC)
@Ellywa: When you specify a colour as a RGB hex triplet (see CSS Color Module Level 3) the hash character (#) is nowadays mandatory. It has always been mandatory for such values when specified in a CSS declaration such as <table style="background-color:#f3f3f3">.
Now for the historical context: prior to HTML 4.0 (December 1997), colour in HTML documents was specified using the BGCOLOR=, TEXT=, LINK=, VLINK= and ALINK= attributes of the <BODY> tag, and the COLOR= attribute of the <FONT> tag. Some browsers also recognised the BGCOLOR= attribute (but not the others) with <TABLE>, <TR>, <TH> and <TD>. When these attributes were used to specify a colour as an RGB hex triplet, many browsers allowed the hash character to be omitted, e.g. <TABLE BGCOLOR=F3F3F3>. All of these techniques were deprecated in HTML 4.0 and declared obsolete in HTML 5.0, and therefore must not be relied upon.
With all that said, the MediaWiki software does permit all of these obsolete techniques to be used, they are not sanitised in any way except for placing double quotes around any unquoted attribute values (so e.g. {| bgcolor=f3f3f3 emits <table bgcolor="f3f3f3">) and therefore the obsolete form is served to the client, and the end result may still work as intended - but only for browsers that recognise these older techniques, not necessarily for all browsers. --Redrose64 🌹 (talk) 12:22, 21 December 2025 (UTC)
thank you sooooo much @Redrose64 and @Timeshifter, indeed I am rather an oldie. This is a tremendous help. Ellywa (talk) 13:16, 21 December 2025 (UTC)

Table of contents

Recently this site has changed its useful TOC to a useless blob on the side of the page. if not open perminally or having to chick a link to open temporarily it is evil and useless godanov (talk) 14:08, 23 December 2025 (UTC)

@Godanov: See Special:Preferences#mw-prefsection-rendering. You might try Vector legacy (2010). It has a different table of contents. --Timeshifter (talk) 17:25, 23 December 2025 (UTC)

Example of table with leader lines

Recently while working on wikisource to convert an old table, I managed to use leader lines in a table that worked fairly satisfactory. I was wondering if this example would merit inclusion in the guide here, since I would like to share how I did this with other users.

{| style="margin: auto; border: none;"
|-
| || H<sub>2</sub> || N<sub>2</sub> || O<sub>2</sub> || CO || CO<sub>2</sub> || N<sub>2</sub>O || C<sub>2</sub>H<sub>4</sub>
|-
| {{ll||<math display=inline> 10^b \eta_0 </math> }}|| 86 || 166 || 187 || 162 || 138 || 135 || 92
|-
| {{ll||<math display=inline> M </math>}} || 2 || 28 || 32 || 28 || 44 || 44 || 28 
|-
| {{ll||<math display=inline> C </math> }} || 79 || 109 || 127 || 100 || 277 || 260 || 272 
|- 
| {{ll||<math display=inline> (2a)^2 \text{(relative)}  </math> }} || 127 || 228 || 206 || 239 || 239 || 261 || 288
|-
| {{ll||<math display=inline> (2a)^3 \text{(relative)} </math> }}|| 1440 || 3440 || 2963 || 3698 || 3686 || 4230 || 4884 
|}

IanVG (talk) 22:18, 18 January 2026 (UTC)

There are no column headers in this table. sapphaline (talk) 12:18, 19 January 2026 (UTC)
I can't test this because Template:ll does not exist. --Redrose64 🌹 (talk) 22:44, 19 January 2026 (UTC)
Woah, that’s weird, I should have tested this on Wikipedia before testing! The template works on Wikisource and looks like this: [my wikisource userpage](https://en.wikisource.org/wiki/User:IanVG/Tables). It’s near the bottom of the page! IanVG (talk) 06:19, 20 January 2026 (UTC)
Or, s:User:IanVG/Tables#Finished table. Will examine later: need to go out for the day. --Redrose64 🌹 (talk) 09:33, 20 January 2026 (UTC)

Unwanted bold and shading

Row split in two

Exceeding double precision

Dark Mode issue: Tables with "style=background: none" are difficult to read.

Potential glitch

Help. Collapsible tables

Need numbers with ~ in front to sort correctly

Making two table the same layout?

Related Articles

Timelines

Top Qs

Fact Checks