Solved

Fixed Column Widths

Posted on 2002-06-28
11
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

626 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