How do I change a column width

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cearlp

Thread Starter
Joined
Sep 25, 2008
Messages
15
The data displayed in a column of a table is truncated although the width of the column is defined to be wider than the data. How can I change the width of the display ?
Attached is the table definition and a screen shot of what is displayed:

<center>
<table width=65% border="0">
<tr>
<td> </td>
<td style="font-size:20px; font-weight:bold;"><?php echo $title?></td>
<input type="hidden" value="<?php echo $id?>" name="memberid">
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right">First Name: </td>
<td><input name="first_name" type="text" value="<?php echo $first_name?>"> </td>
</tr>
<tr>
<td align="right">Last Name: </td>
<td><input name="last_name" type="text" value="<?php echo $last_name?>"> </td>
</tr>
<tr>
<td align="right">First Year: </td>
<td><input name="first_yr" type="text" value="<?php echo $first_yr?>"> </td>
</tr>
<tr>
<td align="right">Last Year: </td>
<td><input name="last_yr" type="text" value="<?php echo $last_yr?>"> </td>
</tr>
<tr>
<td align="right">Address: </td>
<td><input name="address" type="text" value="<?php echo $address?>"> </td>
</tr>
</table>
</center>
 

Attachments

Joined
Mar 28, 2006
Messages
690
Not sure exactly what you're after, but you can define widths of columns (<td>) like so:

<td width="100">Blaablaa</td>

And you can also set the table width to be a fixed px rather than %, as so:

<table width="500">

Just make sure that the combined total of the <td> widths across one row matches the total table width.

Hope that helps
amx
 

cearlp

Thread Starter
Joined
Sep 25, 2008
Messages
15
amanxman,
I already tried making the table width in pixels, and I tried your suggestion of giving the rows a width parameter also, but the result is the same. No matter what widths I try the second column has a box around the <input> field and it truncates the data that is displayed in it. As I stated in my first post, the columns seem to be wide enough, it is only the box outline around the input fields that remain the same size no matter what I set the widths to. I had hoped the partial screen shot of the displayed form would show the end result.
 
Joined
Mar 28, 2006
Messages
690
Ah so you mean you want to change the width of the <input> fields.

If you are using css, you can define the width of the input field pretty easily and exact px values using:

input
{
width: 300px;
}

If you're not using css, define the width/size of each input like this:

<input type="text" size="20" />

The 'size' defines the length of the field in characters (not px), so play around with it until it matches whatever length you're after.

Is that what you're after?

amx
 

cearlp

Thread Starter
Joined
Sep 25, 2008
Messages
15
Yes amanxman, that is exactly what I wanted. After searching around for html tutorials I finally found out just what you posted. Thanks for all your time and advice. The css info is interesting and something I will have to look into.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top