Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to adjust TD width?

Status
Not open for further replies.

ChRaji

Programmer
Nov 16, 2003
1
IN
Hi All,

I am using one table as well as td also the code follows :

<table>
<tr>
<td width=10>
1234
</td>
</tr>
</table>

the above td contains 4 cahrs it's displyaing properly when I am going to enter large value its changing the width of the td.

can I lock td?How ca I do it,Please explain me.

Thanks and Regards
Raji Chinnam
 
You cannot really do that with table. You can set the width, but it the elements inside (text without spaces, image) are bigger than what you specified, the cell will enlarge to accomodate them. You can use this workaround if you want:
Code:
<table> 
<tr>
<td width=&quot;10&quot;>
<div style=&quot;width: 10px; overflow: auto;&quot;>
1234
</div>
</td>
</tr>
</table>

This will make a scrollbar in that cell if the content is too long. Use overflow: hidden; as well, when you don't want to show the the overflowing text.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top