Solved

Need to make a div tag same width as preceding table

Posted on 2011-09-28
5
299 Views
Last Modified: 2012-06-21
I have buttons in a button div tag I'd like to make the same width as the table above it. The buttons can not be part of that table since that's creating weird AJAX jqGrid delays and we solved that by moving it outside the table.

Now I just need to adjust the width.

I can use the padding: and set the right border, but do not want an explicit number of pixels. I want the right edge to line up with the right edge of the table above it.

I would like to use the float style, but want to make it resolution independent.

Can I request the width of the table? Then use that in the div tag?

Thanks.
0
Comment
Question by:newbieweb
[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
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36775235
I would love to see some HTML/CSS, if you have it...
0
 

Author Comment

by:newbieweb
ID: 36895540
I've requested that this question be deleted for the following reason:

We decided to put the button back into the table, which solved the problem. Sorry. I am killing the question. Thanks though...
0
 
LVL 18

Accepted Solution

by:
Rartemass earned 500 total points
ID: 36812649
I know you have requested the question to be deleted, but the general answer for this is to use percentages or ems when dealing with width.
Basically you will need to set the width of the table in ems (eg 10em) then set the width of the button to the same size.
If you already have pixels specified for sizes, you can use a converter to get the em value.
http://riddle.pl/emcalc/

Just for information, ems are a relative size to the width of the letter m in the system font. This means it scales based on the configuration of the system. Viewers can use any screen resolution at the page will still look in scale.
0
 

Author Comment

by:newbieweb
ID: 36895541
I will grant points for that answer event though I am not actively pursuing an answer.
0
 

Author Closing Comment

by:newbieweb
ID: 36895544
Thanks.

And thanks LearnedOne. Sorry to abandon that few that catch your eye lately. Maybe next time...

Cheers.
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
Html split(text) 2 32
CSS for <center> 14 35
ASP.net Will we ever be able to build mobile apps in it 6 32
How to fix 'event logs could not be searched' error asp.net? 3 18
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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