Forum:Template span element having trouble with tables and linebreaks

I'm having major trouble with a template I'm trying to use for mouseover tooltips at the Vanguard wiki, where I can't seem to be able to make it simultaneously useable inline in a paragraph and also in a wikitable cell. The template, Tooltip, exists of a single &lt;span&gt; element which I've tried using &lt;!-- and --&gt; tags to keep all on the same line between &lt;includeonly&gt; and &lt;/includeonly&gt; tags, but I've found that I need to use linebreaks so that it doesn't destroy any table it is inserted into.

I'd like to use it inline such as The quest rewards the Magic Box item. and also in a wikitable such as

At the moment, I have to use linebreaks in the template code, so that it works fine in the wikitable example, but breaks onto a newline in the inline paragraph example. When I keep the template code on the same line, it works fine in the inline paragraph example, but causes any cells following the tooltip in the wikitable example to be ignored as text.

What am I doing wrong - any help appreciated!

- User:Avaera3, 22:14, May 30, 2010 (UTC)