Solved

Need to make a div tag same width as preceding table

Posted on 2011-09-28
5
294 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
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 …

808 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