• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1882
  • Last Modified:

Making the second line of wrapped text indent further than the first

Hey experts

I have a table where the first column is set to a fixed width. That column can contain text that gets pretty long so the text wraps. I would like the to have the text that wraps be indented further than the top line of text, this will make the second line of text appear more as a continuation of the first line as opposed to a second row in the table. So for example:

  This is the first row
  This is the second row with
       a very long text.
  This is the third row.

Any Ideas?
Thanks
David
0
NHBFighter
Asked:
NHBFighter
  • 3
  • 2
1 Solution
 
GrandSchtroumpfCommented:
use the css "text-indent":
http://www.blooberry.com/indexdot/css/properties/text/textindent.htm

<td>
  <div style="text-indent: 2em;">
    Some long text here.
  </div>
</td>
0
 
NHBFighterAuthor Commented:
Thanks for the response, but that doesn't quite have the effect I want. Try out this html and see what I mean:
<table width="300px"><tr><td>
  <div style="text-indent: 2em;">
    This is a very long text that will wrap given the width of the table.
  </div>
</td></tr></table>

the page looks like:
            This is a very long text that will wrap given
     the width of the table.

Instead of like:
     This is a very long text that will wrap given
            the width of the table.

which is how I would like it to display.
0
 
GrandSchtroumpfCommented:
<table width="300px"><tr><td>
  <div style="padding-left: 2em; text-indent: -2em;">
    This is a very long text that will wrap given the width of the table.
  </div>
</td></tr></table>
0
 
NHBFighterAuthor Commented:
That is what I was looking for, Thank you.
0
 
GrandSchtroumpfCommented:
Yes, it was just a matter of sign.  <:°)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now