Solved

Trying to put a tabel in a division

Posted on 2013-07-01
9
215 Views
Last Modified: 2013-07-03
I am trying to put a table inside a division, the table has 3 cols
col1 and col3 being 100px with the remaining  wider center column in the center.
The style for the table was fine until i put into this division.
I am trying to make it look like attachment. After attempting to adjust the floats it is no longer in the division and the table has lost their widths
How can i fix this:

http://roofgenius.com/test3.asp
Books.jpg
0
Comment
Question by:isnoend2001
  • 4
  • 3
  • 2
9 Comments
 

Author Comment

by:isnoend2001
ID: 39292124
I have manage to get the table inside the division red border, but the table cells are not the correct size
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 250 total points
ID: 39292315
actually this is pretty much a pain to work this out cross browser in css

if your div has a known width, which seems to be the case, you can give a width to the middle column. if not, it will only work roperly if your middle column actually has enough content to make it wide enough. this may not be an issue since you'd only need one of the rows to contain that much data to fix it all. you can use a placeholder for that as well.

other than that, you'll have to resort to absolute positioning for the left and right cols, and use 100px margins for the inner one to prevent overlaps.
0
 
LVL 43

Assisted Solution

by:Chris Stanyon
Chris Stanyon earned 250 total points
ID: 39292710
Couple of options here. Either give your table a fixed width (about 620px seem to do the trick), or separate the table from ads. Float one left and one right - they won't clash then.
0
 

Author Closing Comment

by:isnoend2001
ID: 39293924
Thanks
I tried floating them left and right and it did not work. I was probably doing something wrong.
I used absolute positioning
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 26

Expert Comment

by:skullnobrains
ID: 39296549
this is normal : floating stuff left and right at the same time just does not work or at least does not in a cross-browser fashion. the only simple way that does work cross-browser when it comes to left+right positioning inside an element that has no specific size or position is to combine float:left for the inner left element and text-align:right for the parent element, but it is uselessly complicated in this case.
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39296644
floating stuff left and right at the same time just does not work

really! first I've heard of it ;)
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39296876
sorry, the comment was a bit harsh. no hard feelings on my side.

they actualy do not in some browsers (guess which) : one of the float will end up below the other one like this

|                                      float right stuff |
|                                            second line |
|float left stuff                                         |
|                                                               |

Open in new window


even if you play as much as you can with clear and make sure the width are small enough and they do not overlap

i pretty much agree the corresponding browser implementations are weird at best

correcting with position:absolute works as far as i remember but messes up some other browsers since the float gets ignored.
0
 

Author Comment

by:isnoend2001
ID: 39297243
Got it to work with absolute positioning
Had to add this to container:
position: relative;

http://roofgenius.com/test3.asp
0
 
LVL 26

Expert Comment

by:skullnobrains
ID: 39297941
nice and clean ! and i did not even know this would work using an absolutely positionned table (my suggestion actually implied using divs)

thanks a lot for posting back

best regards
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to create a tile layout 1 38
CSS Divs in Safari 3 40
WordPress Themes 10 34
push logos in footer up higher 5 10
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

911 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

20 Experts available now in Live!

Get 1:1 Help Now