tags:

views:

39

answers:

5

How do i set the table under the images to be the same width as the image above? Thanks for your help!

http://cran-web.com/letaky/generate/10

EDIT: I was talking about "tab_cena", not "tab_objednavky". Sorry for misunderstanding.

A: 

Not sure I am fully understanding, but #tab_objednavky style you have width: 160%. Just set that to width: 100% and it will fill the .cell container.

Dustin Laine
The empty table is OK, I was talking about table under each image with "Naše cena 249,- Kč etc." Sorry for this misunderstanding.
Grant
+1  A: 

Set the width of your table (#tab_objednavky) to 100%.

Currently your style shows that you have the width of your table set to 160%.

samer
A: 

Looking at your layout it looks like the width of the image containers is set by the class .cell_1, so just add it to your table and you should set. (Actually you should replace the existing cell class that is already applied to it.)

Andrei
A: 

(Nazdar!)

There are only 2 kinds of measurements you can give the table: a fixed width like 1000px, or a percentage like 100%. If you give a fixed width, then you have to know the width of the items above (4 cells, 249px each). If you give a percentage, then it depends on the size of the element that contains your table.

You can use a percentage to your advantage. Since your table is in a 249px cell and you want it to stretch across 4 cells, try setting the width to 400%. It's a little bit of a hack because you're breaking out of the cell container, but it should work.

A better way would be to make the .cell equal 249px x 4 (996px), and just make the #tab_objednavky table inside it 100% width.

Edit: to answer your question based on the title of your post: you can't do that without using JavaScript to set the size of the container div.

Andrew Vit
The only way to do that without JavaScript I found is to set the div to float, but it works only if I float right or left - and I need it in center. 'code'$(document).ready(function(){ $('#THIS DIV').width($('#cell_img_0_0').width());});This code should work, but doesn't. Any ideas?
Grant
A: 

Why don't you just place the image as the first row of the table?

rmarimon