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

  • SEARCH
  • Home
  • 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 8271265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:47:44+00:00 2026-06-08T06:47:44+00:00

I am working on a really simple app that is styled using twitter-bootstrap-rails. One

  • 0

I am working on a really simple app that is styled using twitter-bootstrap-rails. One my model index page there is a table that displays the data and it looks really great. The problem is that if someone enters a really long string of unbroken text (like a URL for example) into one of the fields, the width of that column with stretch and squish all the other columns. I would like some way to enforce the width of the column and tell the browser to break up really long words.

What I have tried to do so far was for each <th> I have added a class and tried to use CSS to control the width. Here is an example

<table>
  <thead>
    <tr>
      <th class="column1"> etc
      <th class="column2"> etc
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="column1"> etc
      <td class="column2" etc
    </tr>
  </tbody>
</table>

And then I was using this in my stylesheet

th.column1 { width: 300px;
  word-wrap:break-word;}
td.column1 { width: 300px;
  word-wrap:break-word;}

So far that isn’t working for me, and I wonder if I need to be duplicating my code so much.

  • 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-06-08T06:47:45+00:00Added an answer on June 8, 2026 at 6:47 am

    I ended up fixing it on my own. What I did was use max-width instead of width

    th.column1 td.column1 { max-width:300px; word-wrap:break-word; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Morning, everyone! I'm working on a Rails app that is just a simple check
I'm in lean startup mode, working on a simple phone app that will be
I'm currently working on a simple wxPython app that's essentially document based. So far
OK, well I've been working on a simple app that allows users to save
So, I've been working on an app that has a Plan model with a
I'm really new to Ruby on Rails 3 and I'm working on a simple
I'm sure this is really simple, but I can't seem to get it working.
I was using CouchBase Server 1.1.1 for Mac and it's working really well. It
I'm converting a large, multi-project CVS repository into Subversion using cvs2svn. It's working really
I have started using MVC 3 and I really like working with it. It's

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.