MediaWiki talk:Common.css/Archives/2011

From Meta, a Wikimedia project coordination wiki

align="center" does not work with class="wikitable"

Hi All,

I want to use class "wikitable" and center the table. That does not work. I use the following.

{| class="wikitable" align="center"
|-
! Header text !! Header text
|-
| Example || Example
|-
| Example || Example
|}

I expect the table to be centered, but it is not, see below.

Header text Header text
Example Example
Example Example

Browsers: Safari, Chrome.

Does anyone know how to make it work?

Thank you very much for your time.

-- 71.139.13.143 07:22, 17 May 2011 (UTC)

It should work if you wrap the whole thing in div, see below:
Header text Header text
Example Example
Example Example
Cbrown1023 talk 14:29, 17 May 2011 (UTC)
Wonderful! Thank you so very much, Cbrown1023! -- 71.139.13.143 00:12, 21 May 2011 (UTC)

mw-content-rtl is not needed

mw-content-rtl class here sets Tahoma as the default. There is no need for that at all: RTL languages have good fonts by default and changing it here breaks visual uniformity with other RTL wikis. Can anybody please edit it? Thank you. --Amir E. Aharoni 15:27, 2 October 2011 (UTC)

Done. Thanks! Jon Harald Søby 00:34, 3 October 2011 (UTC)
This is a mistake made somewhere down the road. The original version implemented by me named the class "persian", not "rtl". Tahoma is the preferred font for Persian content on the web. I'm going to implement it back, using persian as the class name, again Huji 01:29, 4 October 2011 (UTC)
For Persian, consider doing
:lang(fa) {
    font-family: Tahoma;
}
The whole per-language font handling is going to change massively soon. --Amir E. Aharoni 01:46, 4 October 2011 (UTC)
:lang(fa) or [lang="fa"] should indeed be used instead of .persian. We should not use such classes (since MW 1.18). SPQRobin (talk) 11:18, 4 October 2011 (UTC)
...And of course, for this to work, all section in Persian must be marked as <span lang="fa">کلمات</span> (of course, it can be div, td or any other tag). After you complete the migration to lang="fa", you can retire class="persian".
lang tags are going to become more prominent in the near future. --Amir E. Aharoni 18:07, 4 October 2011 (UTC)

In fact, mw-content-rtl doesn't provide all the expected functionalities. I would like to know where it is defined, to fix it. Also, it disallows using other fonts for some reason :( Can you please direct me to its defintion? Huji 01:36, 4 October 2011 (UTC)

It's in shared.css. I very much want to know about anything you want to fix there.
See also mw:Directionality support. MW 1.18 is a revolution with regard to RTL. It is already deployed here and tomorrow it will be deployed everywhere, so you may want to prepare fa.wikipedia for that. --Amir E. Aharoni 01:46, 4 October 2011 (UTC)