Forum:Fontcolor flaky

the following code produces output that looks like: the source code looks like: text text I dont understand why both lines arent colored yellow. This only seems to happen in a table. I tried it at wikipedia and it worked fine Granpa 19:31, August 15, 2011 (UTC)


 * Here is the link to the fontcolor template
 * http://religion.wikia.com/wiki/Template:Fontcolor
 * Its exactly the same as the one at wikipedia
 * http://en.wikipedia.org/wiki/Template:Fontcolor
 * The source code looks like:
 * Granpa 19:57, August 15, 2011 (UTC)
 * Granpa 19:57, August 15, 2011 (UTC)


 * According to W3Schools.com: "The  tag is used to group inline-elements."   is not an inline element, so a span tag can not affect it. Whether or not it is in a table doesn't make a difference; this is how just HTML works. --Gardimuer { ʈalk } 20:22, August 15, 2011 (UTC)


 * Wikipedia doesnt add the  but our wiki does.
 * I dont know why
 * I tried


 * {|border=1 cellspacing=1
 * }
 * }
 * and the result was:
 * and the result was:

text
 * text
 * }
 * which works fine.
 * Granpa 21:32, August 15, 2011 (UTC)


 * You are right. The MediaWiki syntax is adding  tags in an inconsistent way inside of tables. If I had to guess, I'd say the difference is caused by the fact that Wikia is using version  of the MediaWiki software, whereas Wikipedia is using version 1.17wmf1. But I may be wrong. --Gardimuer { ʈalk } 22:02, August 15, 2011 (UTC)


 * A break by itself in wiki source
 * like this
 * text text
 * is fine but if it is followed by a line break
 * like this
 * text
 * text
 * then it creates trouble.
 * double line breaks also create trouble.
 * Granpa 23:32, August 15, 2011 (UTC)


 * Although you are right about the span+p and html, I think the problem here is just too may things wrong with that template.
 * the documentation doesn't say anything about where/when it can/should be used
 * the template uses "style"
 * I can't even tell where those extra p and /p are coming from!
 * As a rule, any template that has "style=" is just wrong and should be avoided.
 * On another note, did you enable that new crappy editor? I won't be able to help you further while that is enabled.
 * On another note, did you enable that new crappy editor? I won't be able to help you further while that is enabled.


 * is not wrong. The only other way to apply styles is via MediaWiki pages, which most users don't have access to.


 * I turned the editor off.
 * Granpa 21:28, August 15, 2011 (UTC)


 * Spans are not designed to handle multi-lines. They terminate at the end of each line. The  in your code closes the span. You are better off creating a class for the   element itself like:


 * {|border=1 cellspacing=1

Text
 * style="background: yellow"|Text
 * }


 * Or adding it to Wikia.css or Common.css for these elements. Rappy 01:17, August 16, 2011 (UTC)
 * What Rappy said is the best to do.
 * What I said about style= inside a template being wrong is true. Consider 1 template that sets the border and another that sets the color, after the templates are expanded the code will look like this:

lakjf
 * The result:

lakjf
 * Only the last style= works. People who use templates like that one usually get bitten on the ass by this stuff (and other problems that such templates bring).
 * The correct one would give:

lakjf But this is getting off topic, use Rappy's solution.
 * 02:55, August 16, 2011 (UTC)


 * Of course, because having two style attributes is wrong. If you pay attention to your templates and how they work, that's easy to avoid. There's no reason why you should ever have that problem in the first place.