astromex
asked on
Stop <TD> contents pushing out table width.
How do I put a large amount of text in a <TD> without it pushing out the table cell width.
For example:
Say the cell contents are: "abcdefghijklmnopqrstuvwxy z", and my cell with is 100px
I want it to display like this with the text in the 2nd table cell:
|--------------1---------- ----|abcde fghijklmn| |--------- -----3---- ---------- |--------- -----4---- ---------- |
...with the "opqstuvwxyz" being "hidden" underneath <TD>#3.
This IS possible.
I did have the code (which I viewed-source from a Microsoft site) - but I cant find it anymore.
I think I remember it using a table inside a table, or something like that...
For example:
Say the cell contents are: "abcdefghijklmnopqrstuvwxy
I want it to display like this with the text in the 2nd table cell:
|--------------1----------
...with the "opqstuvwxyz" being "hidden" underneath <TD>#3.
This IS possible.
I did have the code (which I viewed-source from a Microsoft site) - but I cant find it anymore.
I think I remember it using a table inside a table, or something like that...
ASKER
hmmm, that sort of thing, but the example I had before supported variable TD widths - whereas your example is set to 100px.
(in other words the div with is set to 100% of the TD width, so if you resize the browser window, you can reveal more/less content)
I tried setting with the div width to % instead of px, but that didnt work - any ideas?
(in other words the div with is set to 100% of the TD width, so if you resize the browser window, you can reveal more/less content)
I tried setting with the div width to % instead of px, but that didnt work - any ideas?
ASKER
I remember the nested tables had a lot to do with it - each TD had a table inside it (I wish I could find the original code sample!!)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
brunobear, thats spot on. I used 100px as an example because the alphabet wouldnt fit in 100px with the EE font - but sorry I should have been more specific.
Are you guys happy to split the points, or what???
Are you guys happy to split the points, or what???
No, give brunobear the points. His comment solved your problem
Batalf
Batalf
ASKER
OK Batalf, Many thanks for your help!
Batalf you certainly deserved points here - I can make it up to you with some extra points in one of the PHP questions i asked. :-)
astormex, glad we could help!
astormex, glad we could help!
Example:
<style type="text/css">
.width100{
width:100px;
overflow:hidden;
}
</style>
<table border="1">
<tr><td><div class="width100">Thissjaks
<tr><td><div class="width100">012345678
</table>