Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Fixed Column Widths

Posted on 2002-06-28
11
Medium Priority
?
270 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 400 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
Technology Partners: 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

705 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