Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Splitting A Word?

by damian1301 (Curate)
on Jul 06, 2001 at 23:07 UTC ( #94559=note: print w/replies, xml ) Need Help??


in reply to Splitting A Word?

You could just set the table width to a certain amount and that way the table will never change and it will wrap the text automatically...

$_.=($=+(6<<1));print(chr(my$a=$_));$^H=$_+$_;$_=$^H; print chr($_-39); # Easy but its ok.

Replies are listed 'Best First'.
Re: Re: Splitting A Word?
by thraxil (Prior) on Jul 07, 2001 at 01:35 UTC

    no, usually the browser will expand the table to fit the text in it if there are really long words. that's the problem mpegman seems to be having. eg,

    <table width="2" border="1"> <tr><td>looooooooooooooong</td></tr> </table>

    gives you:

    looooooooooooooong

    certainly not 2 pixels wide.

    if you're working on a more liquid layout, you could modify one of the regexps given to substitute in a <wbr /> tag instead of a space. that tells the browser that if it needs to wrap text, that's a good spot to do it in. but if it doesn't need to wrap the text, you won't end up with a space in the middle of the word.

    anders pearson

      Oh really? Well, that is because it won't break the word for you. If you explicity state it's length (and restrict the use of <nobr>) then it will wrap on words. Eg.
      <table width="2" border="2"> <tr><td>yeah I am dave and blah blah blah blah blha</td></tr></table>
      which produces.
      yeah I am dave and blah blah blah blah blha


      $_.=($=+(6<<1));print(chr(my$a=$_));$^H=$_+$_;$_=$^H; print chr($_-39); # Easy but its ok.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://94559]
help
Chatterbox?
choroba . o O ( The Czech at-sign is also edible )
[Eily]: the French @ is a mouthful I guess...
[Eily]: choroba Wikipedia gives me Zavináč which doesn't seem to translate to something edible?
[Eily]: (yes I'm very good at using question marks, thank you)
[Discipulus]: O_O frexit for you! even me i tried. it was in the arabic quarter in Granada; they offered as 'tapas' in bars. I eataly somewhere they eat ;=P Sardinia a Pulia iirc
[choroba]: Zavináč
[Eily]: choroba oh, that makes sense :)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-11-21 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?