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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Cell nowrap won't work.

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I want to create a table with 3 columns. Each column a specific width. I don't want values in the first column to wrap. I want them truncated or clipped. But I can't seem to make it work. In addition to nowrap, I've tried style="overflow: hidden" with no luck.

What am I doing wrong?
Code:
<html><head>
</head>
<body>
<table width=40px cellSpacing=0 cellPadding=3 border=1 >
<tr>
<td width=30px noWrap >1234567890abcdefdddddddddddddddddddddddddgHIJKLMN</td>
<td width=10px></td>
<td width=10px></td>
</tr>
</table>
</body></html>
 
As far as I am aware, all the text sent will be printed in a table cell and there is no truncate option. I stand to be corrected though. You would have to do that dynamically.
Your cells total 50px. but this should not affect the result.

Keith
 
As a first option, look at modern coding techniques (why lower case in attributes is good, what is a doctype, what is quoting of values), look at CSS and look at why you do not add px to the width attributes in html.

As a second option, try adding [tt]table-layout: fixed;[/tt] to the table styles.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top