Limit table cell content displayed?

H

harry

Using IE 5.5 (sp2)

I have a table cell whose width is set to i.e <td width="100">

Several cells contents exceed this width, is there a CSS that can only
display the 1st 100px's & chop the rest?

Tried various combniations of style's using "width, clip, overflow" but
seems to just completely ignores any of these settings!

Sample table -

<table>
<tr>
<td width="85"> Access</td>
<td width="40"> aaaa</td>
<td width="100">
12345678901234567890123456789012345678901234567890</td>
<td width="112"> 1</td>
<td width="111"> 1</td>
</tr>
</table>

thanks

harry
 
S

Steve Pugh

harry said:
Using IE 5.5 (sp2)

Is that relevant? What are your users using?
I have a table cell whose width is set to i.e <td width="100">

Several cells contents exceed this width, is there a CSS that can only
display the 1st 100px's & chop the rest?

You need to set table-layout: fixed; for the table and specify a width
for the table. Then you can specify overflow: hidden; for the cells
you want cropped.

It should go without saying that this isn't very user friendly - your
visitors will need to disable CSS to see all the content of your page.

Steve
 
H

harry

Thanks for that Steve will give it a go.

Sorry should have explained it's for an intranet with every user having the
same browser & version

As regards the chopping, I thought I'd set the cell's title attibute to the
full value so they can see it as a tooltip!
 
H

harry

thanks mate - worked perfectly!


harry said:
Thanks for that Steve will give it a go.

Sorry should have explained it's for an intranet with every user having the
same browser & version

As regards the chopping, I thought I'd set the cell's title attibute to the
full value so they can see it as a tooltip!
 
S

Steve Pugh

Please don't top post.
As regards the chopping, I thought I'd set the cell's title attibute to the
full value so they can see it as a tooltip!

And if they want to print it? Or cut and paste the text to another
application?
Design and layout are supposed to enhance and support content not
obscure it, I think you're fixing the wrong problem.

Steve
 

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,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top