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

Nailing down the column width!

Status
Not open for further replies.

Tve

Programmer
May 22, 2000
166
FR
Hi,

I am using some ASP to get data from a database and printing it out in a table.

I'd like to get some control over column widths. When the text is wider the the column width, the whole column expands in width.

How could the the column width fixed and make the overflowing text invisible or printed on the next line?
Is the a CSS that could be applied to the <TD>?

Thierry

AD AUGUSTA PER ANGUSTA

Thierry
 
I kept on searching and I did find this:

<div style=&quot;width:100; height:60; clip:rect(0px 0px 100px 60px); overflow:hidden;&quot;>abcdefghighklmnopqrstuvwxyz</div>

Should suit me.

Thierry

AD AUGUSTA PER ANGUSTA

Thierry
 
Hi Thierry,

I know a solution but, because I use/test in IE4.0 and NN4.73, for me it don't work in NN4.73 (I don't know NN6), but works fine in IE :

see the differences in the 2 examples

first: (this is wrong example)

<table border=1 cellpadding=0 cellspacing=0 width=300>
<tr>
<td width=150 height=90>
Text1Text2 Text1Text2Text3Text4Text5Text6Text7 Text1Text2Text3Text4 Text1Text2Text3Text4Text5Text6Text7 Text1Text2 Text1Text2Text3 Text1Text2Text3Text4 Text1Text2Text3Text4Text5 Text1Text2Text3Text4Text5Text6
</div>
</td>
<td width=150 height=90>
Text1Text2 Text1Text2Text3Text4Text5Text6Text7 Text1Text2Text3Text4 Text1Text2Text3Text4Text5Text6Text7 Text1Text2 Text1Text2Text3 Text1Text2Text3Text4 Text1Text2Text3Text4Text5 Text1Text2Text3Text4Text5Text6
</div>
</td>
</tr>
</table>

second: (this is good example)

<table border=1 cellpadding=0 cellspacing=0 width=300>
<tr>
<td width=150 height=90>
<div style=&quot;width:150px; height:90px; overflow:hidden&quot;>
Text1Text2 Text1Text2Text3Text4Text5Text6Text7 Text1Text2Text3Text4 Text1Text2Text3Text4Text5Text6Text7 Text1Text2 Text1Text2Text3 Text1Text2Text3Text4 Text1Text2Text3Text4Text5 Text1Text2Text3Text4Text5Text6
</div>
</td>
<td width=150 height=90>
<div style=&quot;width:150px; height:90px; overflow:scroll&quot;>
Text1Text2 Text1Text2Text3Text4Text5Text6Text7 Text1Text2Text3Text4 Text1Text2Text3Text4Text5Text6Text7 Text1Text2 Text1Text2Text3 Text1Text2Text3Text4 Text1Text2Text3Text4Text5 Text1Text2Text3Text4Text5Text6
</div>
</td>
</tr>
</table>


Of course you can also put the div-style in a CSS and code:
<div class=&quot;classname&quot;>

Hope this helps,
Erik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top