Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-04-2010, 07:25 PM   PM User | #1
rkeslar
New to the CF scene

 
Join Date: Jun 2010
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
rkeslar is an unknown quantity at this point
Question Span tag inside td won't span entire cell

I have a span tag inside a td in a table and I have a background set on the span tag. I want it to fill the entire cell, but it does not do this. Can anyone see what might be going on?

Thanks

Code:
<table cellspacing="0" rules="all" border="1" id="detailsGrid_ScrollGrid" style="border-collapse:collapse;">


	<tr class="row0" index="0" id="detailsGrid_sr1545164581" style="font-family:Courier New;padding:3px;width:100px;">

		<td id="detailsGrid_r0c3" nowrap="true" style="height: 20px" style="width:100px; height: 20px;">05/31/2009</td>
		<td id="detailsGrid_r0c4" nowrap="true" style="height: 20px" style="width:100px; height: 20px;">
			<span class="EnteredValueClass">$854.00</span>
		</td>
		<td id="detailsGrid_r0c5" nowrap="true"  style="width:100px; height: 20px;">
			<span  class="EnteredValueClass">1,543.00</span>
		</td>
		<td id="detailsGrid_r0c6" nowrap="true" style="width:100px; height: 20px;">
			<span class="EnteredValueClass">$42.00</span>
		</td>
		<td id="detailsGrid_r0c7" nowrap="true" style="width:100px; height: 20px;">
			<span class="EnteredValueClass">158.00</span>
		</td>
		<td id="detailsGrid_r0c8" nowrap="true" style="width:100px; height: 20px;">
			<span class="BlankClass">&nbsp;</span></td>
		<td id="detailsGrid_r0c9" nowrap="true"  style="width:100px; height: 20px;">
			<span class="EnteredValueClass">21.00</span></td>
		<td id="detailsGrid_r0c10" nowrap="true" style="width:100px; height: 20px;">
			<span class="TotalsClass">$896.00</span>
		</td><td id="detailsGrid_r0c11" nowrap="true"  style="width:100px; height: 20px;">
			<span class="TotalsClass">1,722.00</span></td>
	</tr>
</table>



CSS:

span.BlankClass
{
width:100%;
padding: 3px;
}

span.EnteredValueClass
{
font-weight:normal;
font-family: sans-serif;
background-color:#D3D3D3;
color:#000;
width:100%;
text-align:right;
vertical-align:top;
bottom: 0px;
padding: 3px;
}
span.TotalsClass
{
font-weight:normal;
font-family: sans-serif;
/*background-color:#fcc;*/
color:#000;
width:100%;
padding: 3px;
}
rkeslar is offline   Reply With Quote
Old 06-04-2010, 08:03 PM   PM User | #2
met
Regular Coder

 
Join Date: Oct 2009
Location: United Kingdom
Posts: 728
Thanks: 4
Thanked 119 Times in 119 Posts
met has a little shameless behaviour in the past
remove

width:100%;

add

display:block;

to span.EnteredValueClass, presumably.
met is offline   Reply With Quote
Users who have thanked met for this post:
rkeslar (06-04-2010)
Old 06-04-2010, 08:24 PM   PM User | #3
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
To clarify met's post, spans don't fill. They're inline elements. His display:block suggestion effectively turns it into a div.
__________________
Are you a Help Vampire?
tomws is offline   Reply With Quote
The Following 2 Users Say Thank You to tomws For This Useful Post:
effpeetee (06-05-2010), rkeslar (06-04-2010)
Old 06-04-2010, 08:49 PM   PM User | #4
rkeslar
New to the CF scene

 
Join Date: Jun 2010
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
rkeslar is an unknown quantity at this point
Thumbs up Thanks

I understand. Thanks
rkeslar is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:16 PM.


Advertisement
Log in to turn off these ads.