Solved

Fixed Column Widths

Posted on 2002-06-28
11
236 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

920 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

17 Experts available now in Live!

Get 1:1 Help Now