prevent <td> from stretchinggggggggggg despite setting fixed width

B

Ben C

hi.

i have a table and it is fixed to width of 200.

inside a table, there is a dynamically generated content from db.. but as
the retrieved content is very long,

my table will be stretcheddddddddddddddddd to fit in this content.

How do i prevent my table or cells from being stretched by dynamic contents?

Put a div inside the <td> and set width: 200px on the div. The content
from the db goes inside the div. You can control what happens to the
overflow by setting the overflow property on the div.

Another possibility is to experiment with table-layout: fixed.
 
B

Ben C

Thanks for replying..

I have set
style="table-layout:fixed; "

You shouldn't need that as well as the widthed said:
but under the cell:

<td ><div style="width:250px;
overflow:visible"><%=rs("title")%></div></td>

The contents of the cell overflows to other areas. i want it to be able to
be trapped in the div cell...if the contents hits the edge of the cell, it
will automatically be bring down to the next line...as if there is a line
break

There's no way to force line-breaks except at proper line-breaking
points in CSS 2.1 or in most browsers, although IE has a proprietary
property for it (something like word-wrap: break-word).
 
J

Jukka K. Korpela

Scripsit User:

Try telling the original problem first, posting the URL, using your real
name, and learning how to quote on Usenet. You're now apparently discussing
just dead ends in trying to work with problems that you created by solving
the wrong problem in a wrong way. You'll never get the real problem fixed
that way.
 
U

User

hi.

i have a table and it is fixed to width of 200.

inside a table, there is a dynamically generated content from db.. but as
the retrieved content is very long,

my table will be stretcheddddddddddddddddd to fit in this content.

How do i prevent my table or cells from being stretched by dynamic contents?

pls advise.

thanks
 
U

User

Thanks for replying..

I have set
style="table-layout:fixed; "

but under the cell:

<td ><div style="width:250px;
overflow:visible"><%=rs("title")%></div></td>

The contents of the cell overflows to other areas. i want it to be able to
be trapped in the div cell...if the contents hits the edge of the cell, it
will automatically be bring down to the next line...as if there is a line
break

Ben C said:
Put a div inside the <td> and set width: 200px on the div. The content
from the db goes inside the div. You can control what happens to the
overflow by setting the overflow property on the div.

Another possibility is to experiment with table-layout: fixed.
 
U

User

ic.

hmm there has to be a way to totally prevent a td from being stretched...

i believe many ppl has encounter the same problem before

Ben C said:
There's no way to force line-breaks except at proper line-breaking
points in CSS 2.1 or in most browsers, although IE has a proprietary
property for it (something like word-wrap: break-word).
 
D

dorayme

"Jukka K. Korpela said:
Scripsit User:


Try telling the original problem first, posting the URL, using your real
name, and learning how to quote on Usenet. You're now apparently discussing
just dead ends in trying to work with problems that you created by solving
the wrong problem in a wrong way. You'll never get the real problem fixed
that way.

I agree. Use your own name, not necessarily the one on your birth
certificate or even the one on the Deed Poll changed certificate.
I hear you ask: Which one in that case? Well, the one that you
are known by in your circles. What circles? I hear you say.

Good question and I will only babble a bit to fill in a little
space and time till old Korpela weighs in with something more
concise: OK, what about your personal household, Jeffrey? What
does your wife call you? Your kids? Your boss?

Golly now, I can hear you saying so many possible things: you
have a number of wives? A number of classes of kids? A number of
bosses? A number of different names?

Korpela might rule on the legitimacy of bigamists joining this
fine church, alt.html. Or he might rule that you are to choose
the name you use with the wife who is more interested in matters
web than any other wife?

Yes, I hear you ok: none of your wives are the least interested
in matters web! What will Korpela rule on now? Decisions,
decisions. Pull one of the names out of a hat? Are conmen not
welcome even if they are truly truly interested in matters html?

But Korpela is definitely right about your unfortunate choice,
not only to have too many wives and bosses and names but to even
deceive us here with cunningly devised questions to partial
solutions to non-urled problems that would not be worth urling or
ruling on anyway because they would be the wrong answers to the
wrong questions creating problems that multiply like the
epicycles in order to support a problem to go on existing when it
really ought never to have been born, am I making anything at all
clear to you in the temporary absence of old K?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top