This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > March 2007 > Truncating text in a table rather than wrapping to a new line?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Truncating text in a table rather than wrapping to a new line?
lister

2007-03-21, 7:21 pm

Is this possible?

I want fixed height table rows, but long text is wrapping around and
causing the cell, and thus the entire row, to increase in height.

I want any long text to simply truncate.

Many thanks,
Lister

scripts.contact

2007-03-21, 7:21 pm

On Mar 21, 3:07 pm, "lister" <listerofsme...@hotmail.com> wrote:
> I want fixed height table rows, but long text is wrapping around and
> causing the cell, and thus the entire row, to increase in height.
> I want any long text to simply truncate.


overflow:hidden
----
http://msdn.microsoft.com/workshop/...es/overflow.asp
http://www.w3schools.com/htmldom/pr...le_overflow.asp


Test:http://www.w3schools.com/js/tryit.asp?
filename=try_dom_style_overflow

lister

2007-03-22, 7:22 pm

On Mar 21, 10:36 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
> Scripsit lister:
>
>
> Why? That seems to be the problem, so shouldn't you stop wanting that?


Because it looks crap otherwise. All my icons and buttons are designed
for that height.

Yes, I realise differing font sizes will effect row height, and might
even cause some genuine wrapping of important columns and that's fine
- I'm not going to force layout at the expense of useability. But for
this particular column it is not important to be able to see the
entire information, so I just want to show as much as there is room
for.


lister

2007-03-22, 7:22 pm

On Mar 21, 9:23 pm, "scripts.contact" <scripts.cont...@XXXXXXXXXX>
wrote:
>
> overflow:hidden


Thanks! I will give it a go.

Jukka K. Korpela

2007-03-22, 7:22 pm

Scripsit lister:

>
> Because it looks crap otherwise. All my icons and buttons are designed
> for that height.


Then you apparently have to solve that problem too, as part of solving the
problem hat you created by fixed-height rows.

> - I'm not going to force layout at the expense of useability. But for
> this particular column it is not important to be able to see the
> entire information, so I just want to show as much as there is room
> for.


You haven't told _any_ specifics, such as a URL. It is therefore reasonable
to assume that the general advice is applicable: decide on some reasonable
length, and truncate server-side, where you can actually truncate at
meaningful places and include a truncation symbol such as "...".

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

zzpat

2007-03-22, 7:22 pm

lister wrote:
> Is this possible?
>
> I want fixed height table rows, but long text is wrapping around and
> causing the cell, and thus the entire row, to increase in height.
>
> I want any long text to simply truncate.
>
> Many thanks,
> Lister
>


Do what you can to avoid this problem. In other words, don't try to fix
it unless you absolutely have to. Fix the problem that causing the
symptom instead.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews