Solved

Centering within nested table...

Posted on 2008-06-17
5
423 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
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:zemond
Comment Utility

<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
Comment Utility
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
Comment Utility
ohh I see what your saying,

I will work on that for you
0
 
LVL 9

Accepted Solution

by:
zemond earned 250 total points
Comment Utility
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
Comment Utility
Thanks zemond!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now