Community Central
Community Central
Forums: Index Support Requests CSS code problem
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 4379 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


Please have a look on next template:

*Item<onlyinclude><span style="color:#aaa; float:right; display:inline; text-align:right;">· · · · · · · · · · · · · · · · · · · · · · · {{{1|Category}}}</span></onlyinclude>
  • Item A1011· · · · · · · · · · · · · · · · · · · · · · · Category 11
  • Item B22· · · · · · · · · · · · · · · · · · · · · · · Category 7
  • Item C59999· · · · · · · · · · · · · · · · · · · · · · · Category 2

I want the items aligned all left, categories right, and both connected with dotted lines. But I don't get how to expand the dots to the end of text. Could someone give me a solution?  Cafeinlove msg 2012-04-22, 4:37 am 19:37, April 21, 2012 (UTC)

I was going to suggest the following script using the padding functionality, but it appears the padding functionality is not working on Wikia:
{{{1|Item}}}{{#pad:{{{2|Category}}}|{{#expr:80-{{#len:{{{1|Item}}}}}}}|· |left}}
In order for this to work, a monospace font should be used. The 80 I used in the expression is an estimation of the amount of characters that fit in the width of the page using a monospace font. This can fluctuate because different operating systems can have different monospace fonts as defaults. Using a width of 70 or 75 over 80 may increase compatibility, but also leaves some more whitespace at the right margin. Please let me know if the padding functionality works on your Wiki, it does not work on The Elder Scrolls Wiki for unknown reasons, as all other string functions are working. ~ Flightmare 20:52, April 21, 2012 (UTC)
It may be disabled by Wikia as it can be used by denial of service attacks. The default MediaWiki safety setting is configured at 100 characters though. Can someone confirm this? ~ Flightmare 21:02, April 21, 2012 (UTC)
As you said, the template above seems not working on any wiki I'm working on. (ko.seiyuu.wikia, ko.pokemon.wikia) The script may be disabled here.  Cafeinlove msg 2012-04-22, 6:12 am 21:12, April 21, 2012 (UTC)
The #pad string function doesn't work because it has been replaced by the {{padleft}} and {{padright}} Magic Words.
Example:
Code:
*{{{1|Item}}} <span style="letter-spacing:3px;color:#aaa;">{{padleft:<span style="letter-spacing:0px;">{{{2|Category}}}</span>|{{#expr:128-{{#len:{{{1|Item}}}}}}}|·}}</span>
Result:
  • Item ···········································································Category
--Gardimuer { ʈalk } 03:05, April 23, 2012 (UTC)