Solved

Fixed Column Widths

Posted on 2002-06-28
11
225 Views
Last Modified: 2010-04-09
How can I fix the widths of my columns within a table irrespective of the length of text inside.
When I fix a column at 20%, if the text within exceeds 20% the column grows. ( I just want it to cut the text short)
I also don't want to specify 'wrap' on the column because I don't want it to go over 2 lines.

Anyone have a solution

Thanks
0
Comment
Question by:carlmc
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7116032
<table style="table-layout: fixed;">
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 100 total points
ID: 7116046
Bruno gave you part of it, but it can still push out if the text does not have a natural break point like an url. you then need the cell to be like this:

<td style="width:20%;overflow-x:hidden">

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 7117082
a good note, i had thought in my experience that just the first part would stop it from being pushed out however, that the content would just be hidden if it went beyond the specified width.

carlmc, using both would be the best way to go i'm sure....



BRUNO
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7117119
You could also use overflow-x:scroll but it is not very reliable, often breaks something else, and screws up hte height of the rows.

Cd&
0
 

Author Comment

by:carlmc
ID: 7121284
Thanks both of you, You both helped but I had to give the points to Cobol as he was the one who gave me the final solution.

Thanks to both of you
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7121863
Why only a B?  What else were you looking for?  Don't you think it rather unfair to give an inferior grade without saying why and offer a chance to address whatever you consider to be defective in the solution?

Cd&
0
 

Author Comment

by:carlmc
ID: 7121872
Apologies CD,

The answer was perfect - I was meant to give you an Excellent Grade - I didn't even know I hadn't

My mistake - I will take more care next time
0
 
LVL 18

Expert Comment

by:bruno
ID: 7121886
carlmc,

I'm sure Cd& would appreciate if you took the time to address the problem, as it's EASY to take care of.  Simply post a question in Community Support (link on the left) and tell them you mistakenly gave the wrong grade.  They'll be happy to take care of it for you.



BRUNO
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7121912
I understand carlmc. Sometimes the form comes up with the B set as default.  They will have it fixed in the re-write.

Thanks for responding.  I just wanted to make sure we hadn't missed anything.

Cd&
0
 

Expert Comment

by:ComTech
ID: 7122387
As requested by carlmc, I have change the grade to an A as he requested.

Thanks,
ComTech
CS Admin @ EE
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7122416
Thanks carlmc, ComTech, and Bruno. :^)

Cd&
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now