Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  6] [ 7]  / answers: 1 / hits: 17779  / 13 Years ago, wed, march 14, 2012, 12:00:00

I have a table with the following:



<table  cellpadding=2 cellspacing=0 > 
<tr>
<td>Contact: </td>
<td width=100px><div style=overflow-x:scroll; width:100px>[email protected]</div>
</td>
</tr>
</table>


This code shows an horizontal scroll in the email cell.



When the email is a short one like [email protected] the scroll shows but it is not enabled as it is not needed, and when the email is longer let's say



[email protected]



the scroll enables so you can see the entire email.



This is good, but what I need is the scroll not to show at all when the email is a short one.



How can I do that??



I've tried:



overflow-x:auto;


And it does not show the scroll when a short email but when the email is a long one it just cut it no scroll at all. I think this happens because there are no spaces in the email.


More From » css

 Answers
4

By defining overflow-x: scroll you are indicating for a scroll bar to appear no matter what.



You should use overflow-x:auto. Here is a working demo


[#86858] Tuesday, March 13, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rashawn

Total Points: 451
Total Questions: 83
Total Answers: 83

Location: Egypt
Member since Tue, May 3, 2022
2 Years ago
rashawn questions
;