fischermx
asked on
Controling Datalist width
Hi,
I have a datalist that displays a list of URL.
I have the datalist inside a div with a width of 300px.
Some of this URLs are too long and exceed the 300px causing the
datalist to stretching up to 400 or 500 causing a mess in my page. I'd
rather prefer them to look trimmed or wrapped but not to causing the
datalist width to grow.
I tried several techniques with no luck. I put a span surrounding the
linkbutton, also a div, both with a widht of 280px. Also even tried to
create another table cell by placing additional TDs in the item
template. None of this can keep the datalist in the fixed width I want.
Any help is greatly appreciated.
I have a datalist that displays a list of URL.
I have the datalist inside a div with a width of 300px.
Some of this URLs are too long and exceed the 300px causing the
datalist to stretching up to 400 or 500 causing a mess in my page. I'd
rather prefer them to look trimmed or wrapped but not to causing the
datalist width to grow.
I tried several techniques with no luck. I put a span surrounding the
linkbutton, also a div, both with a widht of 280px. Also even tried to
create another table cell by placing additional TDs in the item
template. None of this can keep the datalist in the fixed width I want.
Any help is greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oops, sorry, my mistake, it works !
Just a funny behavior, I have two labels displaying in the same cell, one above other separated by a <br>.
Now the upper label, very long, gets cut, nice, that's what I want, however, in this cases, a blank row is inserted between the two labels. It is like if the upper label would wrap, I mean, it behaves like if it would be wrapped, however, it doesn't wrap, just cut off.
Just a funny behavior, I have two labels displaying in the same cell, one above other separated by a <br>.
Now the upper label, very long, gets cut, nice, that's what I want, however, in this cases, a blank row is inserted between the two labels. It is like if the upper label would wrap, I mean, it behaves like if it would be wrapped, however, it doesn't wrap, just cut off.
that;s the behavior of the table-layout when set to fixed, it guarantees no matter what, the width is fixed.
have u tried specifying the width for the datalist to 300px ..
try defining the div tag with style
DISPLAY: inline; OVERFLOW: auto; WIDTH: 300px; POSITION: absolute; HEIGHT: 300px
This should give a scroll bar to the div tag when the content within it exceeds the width specified
DISPLAY: inline; OVERFLOW: auto; WIDTH: 300px; POSITION: absolute; HEIGHT: 300px
This should give a scroll bar to the div tag when the content within it exceeds the width specified
ASKER
I tried, but I still getting the same effect, see my code :
<asp:repeater id="Repeater1" runat="server">
<headertemplate>
<table border="1" style="TABLE-LAYOUT: fixed; WIDTH: 300px" width="300" >
<col width="300">
<tr>
<td><b class="tableTitle">Vendor<
<td><b class="tableTitle">Categor
<td><b class="tableTitle">Count</
</tr>
</headertemplate>
btw, I change to use a "repeater" to see if it helped, but it behaves the same, the problem is really the table growing, how to make that a table gets really fixed width.