Solved

How to fix the width of a td tag.

Posted on 2002-06-18
16
500 Views
Last Modified: 2006-11-17
Hello,

I try to fix the width of columns :
<td fixed width = 180>test</td>

But the result is that the td tag wraps the text and the td is not wider than the text.

How can I do ?

Thank you.


0
Comment
Question by:laurent_diep
  • 6
  • 3
  • 3
  • +3
16 Comments
 

Expert Comment

by:jusnokso
ID: 7087340
Solution which I usually use are empty transparent 1x1 px gif's. Just create one and put the <img scr="1x1.gif" height="1" width="180" alt=""><br> to your code, it stretches the <td> and keeps the correct size in no mather what.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7087798
jusnosko,

Welcome to Experts-Exchange.  Please read the guidelines for comments and answers.  We submit with comments only unless what we are providing is definitive and complete.  It may turn out that your comment provides a solution, but by posting it as an answer you have removed the question from the active list which will limit discussion.  

Most members of the community would consider your action disrespectful of the user.  Please refrain from doing this in the future.

laurent_diep,

Cell sizing problems can have a number of causes and solutions, and if multiple browsers need to be support it becomes even more difficult.  If the proposed solution does not completely solve the problem, you should reject that, and give us a little more information, about the content of the cell and the browsers you need to support.  posting more of the code or a link to the page would also help.

Cd&
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 100 total points
ID: 7087824
If what you are trying to do is push out the cell size, try doing it this way:

<td width="180" nowrap>test</td>

Cd&
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 

Expert Comment

by:jusnokso
ID: 7087886
sorry for that, it was my first answer.. I'll know next time :)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7088268
No problem happens all the time.  If you are just starting out on the site, you may find some of the threads in this topic area helpful:

http://www.experts-exchange.com/new_users/

Cd&
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7090360
jusnokso

Don't worry, I rejected it for now. Let's see, maybe you still get the points.

** Mindphaser - Community Support Moderator **

0
 

Expert Comment

by:endamcg
ID: 7091986
Hi

jusnokso's comment is quite a common way but note that it also can depend on yout table properties.

If your table is width=100% for example you should try to match your cells to that.
I almost always work with fixed with tables and cells.

Try something like
<table width="650" summary="">
<tr>
 <td width="180"> content </td>
</tr>
<tr>
 <td width="350"> content </td>
</tr>
<tr>
 <td width="120"> content </td>
</tr>

Or you could define all width's using percentages and add felxibility to your table.

Personally I think its best to avoid always using transparent gifs to define your table props, it has caused my problems in the past so I never do it anymore.


0
 

Expert Comment

by:jusnokso
ID: 7092024
"Personally I think its best to avoid always using transparent gifs to define your table props, it has
caused my problems in the past so I never do it anymore."

What kind of problems are u talking 'bout? I've been working as a front-end coder for four years now, and haven't had any problems with those transparent images, contrary.

Defining table and td widths isn't allways enough. Especially NN4.x will stretch your tables according to the td's content, not by the width atribute.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7092382
laurent_diep,

Unless you provide some feed back it is not like you are going to get much help.  We need mor infromation about the setup of thei table and it you don't give it to us, then it is just a guessing game.  

If you want a solution, then participate.

Cd&

0
 

Expert Comment

by:mv_suresh
ID: 7105950
<td style="width=180">

try this, hope this should work for you
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7107138
mv_suresh,

Did you not read the comments in this thread before you posted.  style="width:180" in no different than what has already been posted.  You have been on the site long enough to know better then to use the answer button for such a comment.  I will refer this to the moderators.

I guess part of the problem here is the failure of laurent_diep to give any kind of meaningful response.

Cd&
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7107228
mv_suresh

I rejected your comment per request. COBOLdinosaur gave you a good reason for this rejection. You can always reread our "How to" at http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

** Mindphaser - Community Support Moderator **
0
 

Expert Comment

by:mv_suresh
ID: 7107563
I am sorry, I never read all the answers.

0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7107778
mv_suresh

I think it is part of community sense that you 'listen' to what other people 'say' before you give an answer. These written discussions work like a live discussion. If you don't know what people talk about, it would be better not to comment at all ... That is one big difference here versus newsgroups where people comment without any rules ...

0
 

Author Comment

by:laurent_diep
ID: 7115911
mv_suresh, endamcg, jusnokso : Thank you to answer.

COBOLdinosaur : I tried your "nowrap" option succesfully so the points come to you.

Thanks again.

Laurent_Diep.

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7116041
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Safari On Gmail only html 12 56
AdminLTE with wordpress 15 62
Mobile page Scrolling down when refreshing 4 31
One field not displaying content (ASP Classic) 8 25
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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 …

777 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