Open main menu

UESPWiki β

UESPWiki:Administrator Noticeboard/Archives/Table valign command

< UESPWiki:Administrator Noticeboard/Archives
This is an archive of past UESPWiki:Administrator Noticeboard/Archives discussions. Do not edit the contents of this page, except for maintenance such as updating links.

Table valign command

I tried to middle-align table cells on my user page and found they didn't work right. Does anybody know why the cells in this table are all top aligned? I tried it in different browsers and they were all the same. The same table on Wikipedia works as it should. I worked around it with the vmid class but valign still doesn't work.

{| class=wikitable
|1<br>
2<br>
3
|valign="top"|abc
|valign="middle"|def
|valign="baseline"|ghi
|valign="bottom"|jkl
|}
1

2
3

abc def ghi jkl

Joram 07:13, 6 January 2010 (UTC)

That's because http://www.uesp.net/w/skins/common/shared.css has
td,th,tr{vertical-align:top;}
which overrides the valign parameter. I don't thinkt that css should be there, but you can override it if you use css too:
1

2
3

abc def ghi jkl
Here's some useful reference too: [1] -- Nx / talk 07:23, 6 January 2010 (UTC)
I was a step behind you. I just figured out that the problem was in shared.css and that vertical-align worked. Then I came here and saw your reply.
Some of UESP's templates use valign so that should probably be removed. Joram 07:49, 6 January 2010 (UTC)
It looks like there's a lot of CSS in shared.css that should be in MediaWiki:common.css, see [2]. Shared.css is also missing some code, probably it wasn't updated to the MW1.14 version. -- Nx / talk 07:51, 6 January 2010 (UTC)
This would have to be fixed by the site owner then. I hope nothing more important was missed. Joram 18:34, 7 January 2010 (UTC)
No, any admin can fix it. Maybe one of 'em will notice this.... –rpehTCE 19:03, 7 January 2010 (UTC)
I thought shared.css was only on the server. I haven't worked with CSS alot. I downloaded MW 1.14.1 and posted shared.css here if needed. Joram 19:54, 7 January 2010 (UTC), 20:04, 7 January 2010 (UTC)
Actually, it looks like I'm wrong about that - it does have to be replaced by somebody on the server. That means only Daveh and Nephele can do it. –rpehTCE 20:36, 7 January 2010 (UTC)
Yes, shared.css has to be replaced on the server, then the stuff in my sandbox should be pasted into common.css (though it might need some more tweaking, and I did not remove the line that's causing this problem) -- Nx / talk 22:19, 7 January 2010 (UTC)

Update -- I've updated common.css and changed shared.css to the minified version above. -- Daveh 00:23, 12 January 2010 (UTC)

This changed the title color for tables and possibly others. The forced vertical-align line should also be found and removed or stick with it and I can modify any templates that use valign. ? Joram?Talk 00:44, 12 January 2010 (UTC)
Looks like there's more custom code in http://www.uesp.net/w/skins/monobook/main.css, including the code for table colors. Previously this was loaded after the code in shared.css, but since that is now in Common.css, it's getting overriden. Give me a few minutes to look at it. -- Nx / talk 08:30, 12 January 2010 (UTC)
Ok, this is shorter. To only affect those using the monobook skin, put the following code into MediaWiki:Monobook.css:
table.wikitable,table.greylapse,table.graylapse {
background:#FDF5E6;
}

table.wikitable th,table.greylapse th,table.graylapse th {
background:#F5DEB3;
}

div.Boxmerge,div.NavFrame {
margin:0;
padding:2px;
border:1px solid #aaaaaa;
text-align:center;
border-collapse:collapse;
font-size:95%;
}

div.Boxmerge div.NavFrame {
border-style:hidden;
}

div.NavFrame + div.NavFrame {
border-top-style:hidden;
}

div.NavPic {
background-color:#ffffff;
margin:0;
padding:2px;
float:left;
}

div.NavFrame div.NavHead {
height:1.6em;
font-weight:bold;
font-size:100%;
background-color:#efefef;
position:relative;
}

div.NavFrame p {
font-size:100%;
}

div.NavFrame div.NavContent {
font-size:100%;
}

div.NavFrame div.NavContent p {
font-size:100%;
}

div.NavEnd {
margin:0;
padding:0;
line-height:1px;
clear:both;
}

a.NavToggle {
position:absolute;
top:0;
right:3px;
font-weight:normal;
font-size:smaller;
}

#coordinates {
position:absolute;
z-index:1;
border:none;
background:none;
right:30px;
top:3.7em;
float:right;
margin:0;
padding:0;
line-height:1.5em;
text-align:right;
text-indent:0;
font-size:85%;
text-transform:none;
white-space:nowrap;
}

td.expneg {
text-align:right;
background:#ff9999;
}

td.exppos {
text-align:right;
background:#99ff99;
}
Also, an admin should remove the vertical-align:top declaration now that it has been copied to Common.css, to fix the original problem. -- Nx / talk 08:46, 12 January 2010 (UTC)
I've removed the code for vertical alignment for the default table (and greylapse). Still, I think you're better off using CSS than old html code. --Timenn-<talk> 21:28, 12 January 2010 (UTC)
Ok, re-added the colors for table wikitable. Haven't got around to checking the rest, so I haven't added that yet. --Timenn-<talk> 20:38, 13 January 2010 (UTC)