Limit table cell content displayed?

Discussion in 'HTML' started by harry, Jun 17, 2004.

  1. harry

    harry Guest

    Using IE 5.5 (sp2)

    I have a table cell whose width is set to i.e <td width="100">

    Several cells contents exceed this width, is there a CSS that can only
    display the 1st 100px's & chop the rest?

    Tried various combniations of style's using "width, clip, overflow" but
    seems to just completely ignores any of these settings!

    Sample table -

    <table>
    <tr>
    <td width="85"> Access</td>
    <td width="40"> aaaa</td>
    <td width="100">
    12345678901234567890123456789012345678901234567890</td>
    <td width="112"> 1</td>
    <td width="111"> 1</td>
    </tr>
    </table>

    thanks

    harry
     
    harry, Jun 17, 2004
    #1
    1. Advertising

  2. harry

    Steve Pugh Guest

    "harry" <> wrote:

    >Using IE 5.5 (sp2)


    Is that relevant? What are your users using?

    >I have a table cell whose width is set to i.e <td width="100">
    >
    >Several cells contents exceed this width, is there a CSS that can only
    >display the 1st 100px's & chop the rest?


    You need to set table-layout: fixed; for the table and specify a width
    for the table. Then you can specify overflow: hidden; for the cells
    you want cropped.

    It should go without saying that this isn't very user friendly - your
    visitors will need to disable CSS to see all the content of your page.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Jun 17, 2004
    #2
    1. Advertising

  3. harry

    harry Guest

    Thanks for that Steve will give it a go.

    Sorry should have explained it's for an intranet with every user having the
    same browser & version

    As regards the chopping, I thought I'd set the cell's title attibute to the
    full value so they can see it as a tooltip!


    "Steve Pugh" <> wrote in message
    news:...
    > "harry" <> wrote:
    >
    > >Using IE 5.5 (sp2)

    >
    > Is that relevant? What are your users using?
    >
    > >I have a table cell whose width is set to i.e <td width="100">
    > >
    > >Several cells contents exceed this width, is there a CSS that can only
    > >display the 1st 100px's & chop the rest?

    >
    > You need to set table-layout: fixed; for the table and specify a width
    > for the table. Then you can specify overflow: hidden; for the cells
    > you want cropped.
    >
    > It should go without saying that this isn't very user friendly - your
    > visitors will need to disable CSS to see all the content of your page.
    >
    > Steve
    >
    > --
    > "My theories appal you, my heresies outrage you,
    > I never answer letters and you don't like my tie." - The Doctor
    >
    > Steve Pugh <> <http://steve.pugh.net/>
     
    harry, Jun 17, 2004
    #3
  4. harry

    harry Guest

    thanks mate - worked perfectly!


    "harry" <> wrote in message
    news:b5eAc.2469$...
    > Thanks for that Steve will give it a go.
    >
    > Sorry should have explained it's for an intranet with every user having

    the
    > same browser & version
    >
    > As regards the chopping, I thought I'd set the cell's title attibute to

    the
    > full value so they can see it as a tooltip!
    >
    >
    > "Steve Pugh" <> wrote in message
    > news:...
    > > "harry" <> wrote:
    > >
    > > >Using IE 5.5 (sp2)

    > >
    > > Is that relevant? What are your users using?
    > >
    > > >I have a table cell whose width is set to i.e <td width="100">
    > > >
    > > >Several cells contents exceed this width, is there a CSS that can only
    > > >display the 1st 100px's & chop the rest?

    > >
    > > You need to set table-layout: fixed; for the table and specify a width
    > > for the table. Then you can specify overflow: hidden; for the cells
    > > you want cropped.
    > >
    > > It should go without saying that this isn't very user friendly - your
    > > visitors will need to disable CSS to see all the content of your page.
    > >
    > > Steve
    > >
    > > --
    > > "My theories appal you, my heresies outrage you,
    > > I never answer letters and you don't like my tie." - The Doctor
    > >
    > > Steve Pugh <> <http://steve.pugh.net/>

    >
    >
     
    harry, Jun 17, 2004
    #4
  5. harry

    Steve Pugh Guest

    "harry" <> wrote:

    Please don't top post.

    >As regards the chopping, I thought I'd set the cell's title attibute to the
    >full value so they can see it as a tooltip!


    And if they want to print it? Or cut and paste the text to another
    application?
    Design and layout are supposed to enhance and support content not
    obscure it, I think you're fixing the wrong problem.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Jun 17, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    3
    Views:
    10,648
    ifigureditout
    Jul 23, 2009
  2. Phillip Roncoroni
    Replies:
    14
    Views:
    1,127
    Toby A Inkster
    Apr 5, 2004
  3. Replies:
    0
    Views:
    752
  4. boney
    Replies:
    1
    Views:
    592
  5. RJ
    Replies:
    1
    Views:
    254
    Eliyahu Goldin
    Feb 17, 2005
Loading...

Share This Page