Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to make a div tag same width as preceding table

Posted on 2011-09-28
5
Medium Priority
?
315 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 1500 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

Technology Partners: 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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

598 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