Give help. Get help.

  • # November 18, 2012 at 7:34 pm

    Is there a way to control where wrapping occurs, when required, for text within a table column?

    Taking an example from my site

    If the browser width demands wrapping then the first level of wrapping in the player column is:

    Ken Bald & Malcolm

    I would prefer the wrapping to be:

    Ken Bald &
    Malcolm Fletcher

    I also require that the wrapping can go even further, again when required, to:

    Bald &

    Is this possible with CSS and/or JavaScript?

    # November 18, 2012 at 7:58 pm

    It’s possible to break it after each word but I’m not sure you’d always want that. For very, very short names, you might actually prefer it on one line. Example:

    Jo Lee &

    Actually looks better/more balanced than:

    Lee &

    Nothing wrong using <br />, I’d say.

    # November 19, 2012 at 2:39 am

    @andy_unleash Your solution is not quite perfect but a big improvement on what I had. Thank you.

    See this [CodePen]( for an implementation. Resize your browser window to see the effect.

    Using media queries should allow me to come up with the perfect solution. I’ll post a comment when I’ve done that. It will be several hours before I get back to this.

    # November 19, 2012 at 2:17 pm

    As promised I have updated to work exactly how I want the wrapping to work. Many thanks to @andy_unleash for the idea.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.