473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Overflow cell in a table

HaLo2FrEeEk
404 256MB
I'm having an issue with a table. I know I'm supposed to use divs, but there is no easy way to do the layout that I needed to achieve with divs.

Basically I've got a table that has 5 rows displaying a description, address, phone, and fax, then one that acts as a spacer. Next to that, using a colspan, is a cell that contains an image. Now this image should be no more than 350px in width, so I've put a div in the cell with the image inside it and used width: 350px, overflow: hidden. I'm not wanting to limit the height, but therein lies my problem. If the image is taller than the maximum height of the table, then all the cells get stretched in height. I need a way to make an "overflow" cell that will take up the rest of the height from the image.

For example, if my table is only 200px in height without the image, assuming equal cell height, each cell would be 40px tall. If my image is 400px in height though, that would make the table 400px high, stretching the height of each of the cells to 80px. I'd rather add an empty cell at the bottom of the table that can stretch to take up the extra height from the image, without affecting the rest of my cells.

Is something like this possible? It seems like it should be, and I can't shake the feeling that it has to do with colspan and rowspan, but I just can't figure out how to do it.

Also, I'm on a deadline, so a quick reply will be VERY much appreciated.
Aug 8 '10 #1
7 7982
johny10151981
1,059 1GB
Expand|Select|Wrap|Line Numbers
  1. <table cellpadding=10 cellspacing=10>
  2. <TR height="30px">
  3. <td>overflow</td>
  4. <td>:</td>
  5. <td>visible</td>
  6. <td> <div style="overflow:visible;height:30"><!--<img src="hitler.jpg"/>--></td>
  7. </TR>
  8.  
  9. <TR height="30px">
  10. <td>overflow</td>
  11. <td>:</td>
  12. <td>hidden</td>
  13. <td> <div style="overflow:hidden;height:30"><img src="hitler.jpg"/></td>
  14. </TR>
  15.  
  16. <TR height="30px">
  17. <td>overflow</td>
  18. <td>:</td>
  19. <td>scroll</td>
  20. <td> <div style="overflow:scroll;height:30"><img src="hitler.jpg"/></td>
  21. </TR>
  22.  
  23. <TR height="30px">
  24. <td>overflow</td>
  25. <td>:</td>
  26. <td>auto</td>
  27. <td> <div style="overflow:auto;height:30"><img src="hitler.jpg"/></td>
  28. </TR>
  29.  
  30. <TR height="30px">
  31. <td>overflow</td>
  32. <td>:</td>
  33. <td>inherit</td>
  34. <td> <div style="overflow:inherit;height:30"><img src="hitler.jpg"/></td>
  35. </TR>
  36. </table>
if it give you any idea :)
Aug 8 '10 #2
HaLo2FrEeEk
404 256MB
Well like I said, I don't want to impose any height limits on the image. It won't ever be larger than 350px wide, but it can be any height. How will setting the overflow field on the div containing the image make a table row take up the extra slack?
Aug 8 '10 #3
johny10151981
1,059 1GB
Ok, Here is the deal try to understand what line 6 did.
First enable the image tag in line 6 and then disable all other image tag in the table. I hope you can get some idea on how to do it. Even if it dont help you. can you please give a snapshot or a sample diagram. It may help us to think more clearly
Aug 9 '10 #4
HaLo2FrEeEk
404 256MB
I know how to use the code you posted, I'm saying it's not what I need to solve my problem. Your code imposes a 30 pixel height limit. I do not want a height limit. If my table is 200 pixels high and I put an image that is 300 pixels high, I want to have a cell at the bottom of the table that will stretch the extra 100 pixels, leaving the other table cells intact. There is no way this is not possible. Maybe I just have to use multiple tables, with the information in 1 table and the image in the other.
Aug 9 '10 #5
@johny10151981 - i realize this will be deleted for not actually applying to the question BUT, i think its hilar that you are using hitler.jpg as your image
Aug 12 '10 #6
Expand|Select|Wrap|Line Numbers
  1. |-------------|--------|
  2. |_____desc____|        |
  3. |__address____|        |
  4. |____phone____|  img   |
  5. |_____fax_____|        |
  6. |___spacer____|________|
  7.  
is this what you table looks like? if so, then you can make it so that the spacer cell resizes with the img cell and the other cells stay in tact. if this is NOT what it looks like then post some code so we can help better
Aug 12 '10 #7
johny10151981
1,059 1GB
If you only notice the hitler not my message. Then this information for you.

At the same time i was reading an article about hitler and that image was immediately downloaded and that code was immediately created for the question as answer?
Aug 12 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: johkar | last post by:
I only have IE 6 and dial-up. Can you help me determine which browsers support this code? Thanks, John <html> <head> <title>Fixed Table Headers</title> <script language="JavaScript"...
1
by: Marek Mänd | last post by:
I have question regarding CSS overflow atribute. <body> <table style="height:100%" id="pagetable"> <td style="vertical-align:top;"> <div...
5
by: cool2005 | last post by:
I have a table contains 4 cells (2 x 2) like this http://www.coolshare.com/planttrade/temp/gap.jpg each cell contains a div and the div contains a table. As you can see from the image above,...
3
by: Sandy Bremmer | last post by:
I was curious how one goes about properly creates a table row with multiple TD cells as a single hyperlink because I have seen examples of what I think is invalid and poorly conceived HTML. It...
1
by: Kleist | last post by:
Hi! The XML document is created dynamically. I need to convert it in PDF format. Actually, this is a huge table with data. I don`t know in advance, how much columns it will have. I apply XSL-FO...
1
by: meworkingman | last post by:
I'm a relative CSS newbie and I'm trying to do the following: I have a table that holds text that might span multiple cells. I want it to look something like this: ...
4
by: [Jongware] | last post by:
I'm a bit stumped about this request on an Adobe forum. Apparently, exporting a table from their flagship InDesign to XML produces the following output for a table (only first 2 rows listed; after...
10
by: gater | last post by:
Hello All. I am trying to set up a page that will display the 'picture of month' for each month of a given year. I want 3 columns of thumbs. There may be no images or up to 12 images for any given ...
6
by: Roderik | last post by:
I was wondering if there is a good way to avoid a table but achieve the following similar behaviour: Two divs of equal height and undefined width next to each other with a total width of 100%....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.