Solved

Centering within nested table...

Posted on 2008-06-17
5
427 Views
Last Modified: 2011-10-19
I have a bar graph that is updating on the fly using javascript.  The outer table has a light color that shows the outer limit, the inner table is the actual progress.  I want to show a percentage of progress inside the progress bar, centered.

Right now it centers the percentage figure in the nested table.  Is it possible to center it in the outer table and still keep the structure of the bar graph the same.

I'm open to a css solution as well.
<table width=600 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=100% height=30 bgcolor=#cccccc valign=bottom>
	<table id='graph_table' style='width:250px' height=30 border=0 cellpadding=0 cellspacing=0>
	<tr>
	<td id='graph_td' height=100% width=100% valign=bottom bgcolor=#666666 align='center' valign='middle'>
	<span id='total_credits' style='color:white; font-weight:bold;'>48%</span>
	</td>
	</tr>
	</table>
</td>
</tr>
</table>

Open in new window

bar-graph.gif
0
Comment
Question by:danrwhit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:zemond
ID: 21808205

<table width="600" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%" height="30" align="center" bgcolor="#cccccc" valign="bottom">
		
			<table id="graph_table" style="width:250px" height="30" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td id="graph_td" height="100%" width="100%" valign="bottom" bgcolor="#666666" align="center">
						<span id="total_credits" style="color:white; font-weight:bold;">48%</span>
					</td>
				</tr>
			</table>
		
		
		</td>
	</tr>
</table>

Open in new window

0
 
LVL 1

Author Comment

by:danrwhit
ID: 21810394
zemond,

Thanks for replying.  I actually need just the percentage to be aligned in the center, not the nested table.

Any ideas on that?  I'm going to double the points up to 250 on this one.
0
 
LVL 9

Expert Comment

by:zemond
ID: 21810776
ohh I see what your saying,

I will work on that for you
0
 
LVL 9

Accepted Solution

by:
zemond earned 250 total points
ID: 21810796
try this one mate,
<table width="600" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%" height="30" align="left" bgcolor="#cccccc" valign="bottom">
		
        	<span id="total_credits" style="color:white; position:absolute; width:600px; text-align:center; line-height:30px; font-weight:bold;">48%</span>
			<table id="graph_table" style="width:250px" height="30" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td id="graph_td" height="100%" width="100%" bgcolor="#666666" align="center">
						
					</td>
				</tr>
			</table>
		
		
		</td>
	</tr>
</table>

Open in new window

0
 
LVL 1

Author Closing Comment

by:danrwhit
ID: 31468089
Thanks zemond!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Internet Explorer View > Style menu 3 33
CSS (jquiry mobile) question 3 34
CSS overflow problem 21 41
jQuery menu problem in an older browser 6 27
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question