...

View Full Version : <span> content not displaying



tom123
02-26-2008, 03:31 PM
Hi

I have the following piece of html where the variables inside the spans may sometimes have no content.


<li class="lsResultEvent">
<span class="name">#qSearchDetailsSorted.EventName#</span>
<span class="eventName">#qSearchDetailsSorted.Runner#</span>
<span class="date">#date#</span>
</li>

and css:


.lsResultEvent {
margin-bottom: 1px;
}
.lsResult .lsResultEvent .name {
float: left;
width: 320px;
padding-left: 10px;
}
.lsResult .lsResultEvent .eventName {
float: left;
width: 119px;
text-align: center;
display: block;
}
.lsResult .lsResultEvent .date {
float: left;
width: 110px;
text-align: right;
padding-right: 10px;
font-weight: bold;
}


The problem is that whenever one of the variable doesnt have any content then the span is ignored and that row ill have only 2 or 1 colums, therefore makin it all out alignment.

Is their a property i can apply to my classes?

Thanks in advance

VIPStephan
02-26-2008, 03:43 PM
Why arenít you using a table when this looks like youíre outputting tabular data and a table would be the only correct way?

jcdevelopment
02-26-2008, 03:53 PM
if you dont mind me asking, and you may be doing it a specific way, but why dont you do this



<li class="lsResultEvent">
<ul>
<li class="name">#qSearchDetailsSorted.EventName#</li>
<li class="eventName">#qSearchDetailsSorted.Runner#</li>
<li class="date">#date#</li>
</ul>
</li>


instead of this



<li class="lsResultEvent">
<span class="name">#qSearchDetailsSorted.EventName#</span>
<span class="eventName">#qSearchDetailsSorted.Runner#</span>
<span class="date">#date#</span>
</li>


wouldnt lists stay the way they are no matter if there is information or not! I might be wrong, but its just a suggestion!

tom123
02-26-2008, 05:06 PM
To answer VIPStephan:
I simply adjusting existing code and it was set up in that way, could the use of lists instead of divs or tables be causing this error?

jcdevelopment:
Using unordered lists inside the list would not produce the correct layout.
I have parents list which has tabular data inside it.

Apostropartheid
02-26-2008, 05:08 PM
It really shouldn't do that. Have you tried setting a height?
And unordered lists don't have to be bulleted. Or go down, for that matter.

tom123
02-27-2008, 05:00 PM
Setting a height fixed the problem :-)

VIPStephan
02-28-2008, 03:57 AM
Hello? Anybody listening to me? A table is the only correct way to go here!

sobrien79
02-28-2008, 04:36 PM
I agree, VIPStephan, tables would be the way to go in this situation. Seems like a case where a previous developer missed the semantics train and just removed all tables from their site in an effort to bring it up to standards.

Tables have their place in html. This is the exact case.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum