Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:45:03+00:00 2026-05-31T22:45:03+00:00

I am using CSS, but for the sake of quick testing I’m just using

  • 0

I am using CSS, but for the sake of quick testing I’m just using an inline style. This is the code I am trying to implement:

echo "<td style='height=10px; width=10px;'>";

it makes sure that the max width of the cell is 10px , however the height overflows with the text so and it get very large (high).

what I am trying to achieve is any information that is in that cell more than 30 characters I want to hide so you can’t see it.

(I know 30 characters is more than 10px but I am just playing to see if it worked!)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:45:05+00:00Added an answer on May 31, 2026 at 10:45 pm

    Your syntax is wrong:

    Bad

    echo "<td style='height=10px; width=10px;'>";
    

    Good

    echo "<td style='height:10px; width:10px;'>";
    

    However, this doesn’t fix the problem. The way I read the spec, only fixed layout tables are allowed to clip their content on overflow (versus resizing to accommodate it).

    A better/simpler way would be to use a DIV.

    See this example: http://jsfiddle.net/Aa4JL/

    However, if your data is tabular and you need to use a table, you can achieve the same effect by wrapping the cell’s contents in a DIV.

    <table>
        <tr>
         <td><div style='height:10px; width:10px; overflow: hidden;'>This text is clipped.</div></td>         
        </tr>
    </table>​
    

    Note that if you don’t care about clipping based on height you can achieve a nice ellipses effect using fixed layout tables combined with white-space: nowrap combined with text-overflow: ellipsis. This does not require wrapping the content with a DIV. Note that the ellipsis effect will only work in newer browsers (content should still be clipped in older browsers).

    <table style="table-layout:fixed;width:50px;">
        <tr>
         <td style='width:50px; overflow: hidden; white-space:nowrap; text-overflow: ellipsis;'>Long string of text with nice ellipses effect.</td>         
        </tr>
    </table>
    

    This fiddle has all the techniques I’ve just described: http://jsfiddle.net/Aa4JL/4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using css (not a inline one, but external stylesheet) how do i override the
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I'm trying to create flowing content using CSS columns, but I'm running into the
I have an iframe which I'm trying to center using CSS, but is there
By using css or jquery it's easy to bring this grouped buttons. But in
I have a feeling that this probably is not possible using strictly CSS, but,
I am trying to change the colors of a link using css but for
How would I do the following, preferably just using CSS (but possibly jquery too)
I am trying to create a web page using CSS (Table less) but my
I'm using the W3C CSS Validator with the Profile CSS3 but the validator says

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.