2

I'd like to make the entire cell in a MediaWiki table clickable, and not just the text inside it. I start off with this, for example:

{| style="width:400px;background-color:yellow;"
|-
|[[Article1|Tree]]||style="background-color:green"|[[Article2|Hat]]||[[Article3|Shoe]]
|-
|}

And, as expected, only the text is clickable. Can I rejig something to make it work?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
dojo
  • 23
  • 5
  • possible duplicate of [Making a TD clickable](http://stackoverflow.com/questions/19326426/making-a-td-clickable) – leo May 07 '14 at 13:39

1 Answers1

2

You can make the link fill upp the whole cell using CSS. Unless you turned that functionality off, use MediaWiki:Common.css to add your CSS:

td.clickablecell a {
    display:block;
    width:100%;
}

and then add the class to your cell:

{| 
 |-
 |                         [[Article1|Tree]]
 | class="clickablecell" | [[Article2|Hat]]
 |                         [[Article3|Shoe]]
|}
leo
  • 8,106
  • 7
  • 48
  • 80