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 3603450
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:52:25+00:00 2026-05-18T20:52:25+00:00

In my table I set the width of the first cell in a column

  • 0

In my table I set the width of the first cell in a column to be 100px.
However, when the text in one of the cell in this column is too long, the width of the column becomes more than 100px. How could I disable this expansion?

  • 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-18T20:52:26+00:00Added an answer on May 18, 2026 at 8:52 pm

    I played with it for a bit because I had trouble figuring it out.

    You need to set the cell width (either th or td worked, I set both) AND set the table-layout to fixed. For some reason, the cell width seems to only stay fixed if the table width is set, too (I think that’s silly but whatev).

    Also, it is useful to set the overflow property to hidden to prevent any extra text from coming out of the table.

    You should make sure to leave all of the bordering and sizing for CSS, too.

    Ok so here’s what I have:

    table {
      border: 1px solid black;
      table-layout: fixed;
      width: 200px;
    }
    
    th,
    td {
      border: 1px solid black;
      width: 100px;
      overflow: hidden;
    }
    <table>
      <tr>
        <th>header 1</th>
        <th>header 234567895678657</th>
      </tr>
      <tr>
        <td>data asdfasdfasdfasdfasdf</td>
        <td>data 2</td>
      </tr>
    </table>

    Here it is in JSFiddle

    This guy had a similar problem: Table cell widths – fixing width, wrapping/truncating long words

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

Sidebar

Related Questions

I have a table cell for which I set its contentView to a custom
this post is a long one sorry for that but the problem is complex
I need to do a join with a table/result-set/whatever that has the integers n
I have a table with say 1640 items. I set bindingSource.Filter = some filter
I have a set of records in my MS SQL table. With Date as
A simple stupid UPDATE table SET something=another WHERE (always true) in accident will easily
I have a pretty standard table set-up in a current application using the .NET
When you run something similar to: UPDATE table SET datetime = NOW(); on a
I created a field in my table and set it as the index but
Is there a way to set a table's visibility to false, if the table

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.