Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

div and span layout and whitespace

Status
Not open for further replies.

thysonj

Programmer
Jul 6, 2001
240
US
is it possible to eliminate whitespace when formatting a table as such
Code:
<style>
span 
{
	FONT-FAMILY:verdana, arial, helvetica, sans-serif;
	COLOR:#000033;
	FONT-SIZE:11px;
	letter-spacing:;
	position: relative;
	text-decoration:none;
	display:inline;
}
</style>
<table bgcolor="#d4d2cc" height="200" align="center" border="1"  style="border-collapse:collapse;FONT-FAMILY:verdana, arial, helvetica, sans-serif;FONT-SIZE:10px;">
<tr>
	<td valign="top" align="center">
		<span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=1" onClick="parent.document.getElementById('tabH').value='1'">General</a></span>
		<span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=2" onClick="parent.document.getElementById('tabH').value='2'">Screenings</a></span>
		<span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=3" onClick="parent.document.getElementById('tabH').value='3'">Trainings</a></span>
		<span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=4" onClick="parent.document.getElementById('tabH').value='4'">Certifications</a></span>
<a href="accountDisplay.asp?id=519&tab=1" onClick="parent.document.getElementById('tabH').value='1'"><img src="../images/tabopen.gif" ></a><a href="accountDisplay.asp?id=519&tab=2" onClick="parent.document.getElementById('tabH').value='2'"><img src="../images/tabclosed.gif" ></a><a href="accountDisplay.asp?id=519&tab=3" onClick="parent.document.getElementById('tabH').value='3'"><img src="../images/tabclosed.gif" ></a><a href="accountDisplay.asp?id=519&tab=4" onClick="parent.document.getElementById('tabH').value='4'"><img src="../images/tabclosed.gif" ></a>
	</td>
</tr>
the problem is that the span tags and the images are in a td so when i put the span tags in(either at the bginning or the end) and reposition them there ends up being a space where the spans originate. This causes far too much white space. is there a way to put a span tag in a position it and have the whitespace eliminated?
 
Try removing the carriage-returns:

Code:
<td valign="top" align="center"><span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=1" onClick="parent.document.getElementById('tabH').value='1'">General</a></span><span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=2" onClick="parent.document.getElementById('tabH').value='2'">Screenings</a></span><span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=3" onClick="parent.document.getElementById('tabH').value='3'">Trainings</a></span><span style="width:98px;bottom:-15;"><a href="accountDisplay.asp?id=519&tab=4" onClick="parent.document.getElementById('tabH').value='4'">Certifications</a></span>
<a href="accountDisplay.asp?id=519&tab=1" onClick="parent.document.getElementById('tabH').value='1'"><img src="../images/tabopen.gif" ></a><a href="accountDisplay.asp?id=519&tab=2" onClick="parent.document.getElementById('tabH').value='2'"><img src="../images/tabclosed.gif" ></a><a href="accountDisplay.asp?id=519&tab=3" onClick="parent.document.getElementById('tabH').value='3'"><img src="../images/tabclosed.gif" ></a><a href="accountDisplay.asp?id=519&tab=4" onClick="parent.document.getElementById('tabH').value='4'"><img src="../images/tabclosed.gif" ></a></td>

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Did that and no luck. It seems like when you place a span and then reposition it it still holds a the original place for it. I thought when it was repositioned it shifted everything else as if the span was not there in the first place.
 
Just as a caution. Have you tried your page in standards-compliant browsers (Mozilla, FF, Opera, Safari?). You don't specify units with your bottom positioning and you are applying width to an inline element. I cannot test that right now, because I don't have my computer here, but I think that could be causing some problems.
 
I'll have to check that when I get a chance. I fixed this but cannot remember what the solution was.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top