How to wrap up text shown with a table cell after a certain length intervals ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arunava1979
    New Member
    • Apr 2007
    • 2

    How to wrap up text shown with a table cell after a certain length intervals ?

    I have a requirement to wrap a text shown within a table after 60 characters

    here is what I have
    <table width="50%">
    <tr>
    <td width="25%">
    This is a text that needs to be wrapped after every 60 characters.This is a text that needs to be wrapped after every 60 characters.This is a text that needs to be wrapped after every 60 characters.
    </td>
    </tr>
    <.table>
    The text wraps automatically in IE but I need to make it wrap exactly at sixty characters. So a 240 character long text should end up getting diplayed in 4 lines in IE within the table cell.How do I adjust this table width? Is there any way to do this using CSS or any other ways.

    Thanks a lot for your help
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    Originally posted by arunava1979
    I have a requirement to wrap a text shown within a table after 60 characters

    here is what I have
    <table width="50%">
    <tr>
    <td width="25%">
    This is a text that needs to be wrapped after every 60 characters.This is a text that needs to be wrapped after every 60 characters.This is a text that needs to be wrapped after every 60 characters.
    </td>
    </tr>
    <.table>
    The text wraps automatically in IE but I need to make it wrap exactly at sixty characters. So a 240 character long text should end up getting diplayed in 4 lines in IE within the table cell.How do I adjust this table width? Is there any way to do this using CSS or any other ways.

    Thanks a lot for your help
    Yes, you can apply styles to a table here is a link that should help. Here is another.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      You would have to do a little manipulating of the font sizes because you want to make the size of the cell relative to the number of characters and the number of characters on a line is related to the size of the font.

      You can set the size of the cell using em which is the size of the current font but if you set the width of the cell as 600px but each character is 1em wide and an em equals 16px then 60 characters equals 960px.

      So a bit of a juggling act there.

      Comment

      Working...