Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Stop auto size of table cells? (http://www.velocityreviews.com/forums/t158030-stop-auto-size-of-table-cells.html)

harry 05-14-2004 10:58 AM

Stop auto size of table cells?
 
Is there anyway to prevent a table cell from expanding to fit all the data
in it? i.e the datas 50 char's long but I only want to display the 1st 10
chars?

thanks

harry



Matthias Gutfeldt 05-14-2004 11:08 AM

Re: Stop auto size of table cells?
 
harry wrote:
> Is there anyway to prevent a table cell from expanding to fit all the data
> in it? i.e the datas 50 char's long but I only want to display the 1st 10
> chars?


I couldn't get it to work with the td directly, probably because the
table has ideas of its own about its width. But wrapping the content in
a suitable container should work, e.g

p {width:5em; overflow:hidden}

And in CSS there's no unit for the width of a character. But 5em should
be close enough, just adjust the value until you're happy with it.

See <http://www.w3.org/TR/CSS2/visufx.html#propdef-overflow> for other
overflow values.


Matthias


harry 05-14-2004 11:11 AM

Re: Stop auto size of table cells?
 
Thanks Matt, found this also style="table-layout:fixed;" which displays as
many as possible but chops off the remaining - just what I wanted!

cheers!


"Matthias Gutfeldt" <say-no-to-spam@gmx.net> wrote in message
news:2gjnkuF3ki28U1@uni-berlin.de...
> harry wrote:
> > Is there anyway to prevent a table cell from expanding to fit all the

data
> > in it? i.e the datas 50 char's long but I only want to display the 1st

10
> > chars?

>
> I couldn't get it to work with the td directly, probably because the
> table has ideas of its own about its width. But wrapping the content in
> a suitable container should work, e.g
>
> p {width:5em; overflow:hidden}
>
> And in CSS there's no unit for the width of a character. But 5em should
> be close enough, just adjust the value until you're happy with it.
>
> See <http://www.w3.org/TR/CSS2/visufx.html#propdef-overflow> for other
> overflow values.
>
>
> Matthias
>





All times are GMT. The time now is 01:13 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.