How to pad an image??

A

Arthur Dent

I have an image tag which i am putting out in a repeater. The repeater
itemtemplate is basically:

<itemtemplate>
<a href=abc>
<img src=xyz>
</a>
</itemtemplate>

I cannot seem to get my images to have any vertical padding. Ive tried
adding both of the following:

style="padding-bottom: 10px;"
vspace="5px"
style="margin-bottom: 10px;"

Nothing seems to work. my images keep winding up (after wrapping) with the
bottom of one row
right on top of the top of the next row. I need to put some space in
between, but the browser
doesnt seem to want to.

Thanks in advance,
- Arthur Dent.
 
A

Arthur Dent

Problem with divs is that i need the images to all be on one line until they
fill it, then wrap.
Divs always want to wrap, which would put each image on a new line.

I thought about tables, but trying to do tables in a repeater is so
cumbersome. I had hoped id
be able to simply pad the images. I mean, the docs all say that you can, ...
i guess its just
another case of "We dont care what the doc says, well do what we want"?
 
M

Mythran

Arthur Dent said:
Problem with divs is that i need the images to all be on one line until
they fill it, then wrap.
Divs always want to wrap, which would put each image on a new line.

I thought about tables, but trying to do tables in a repeater is so
cumbersome. I had hoped id
be able to simply pad the images. I mean, the docs all say that you can,
... i guess its just
another case of "We dont care what the doc says, well do what we want"?

1.) Use SPAN's (they don't wrap unless told to).
2.) Set the display style on the div so it doesn't wrap :)

HTH,
Mythran
 
A

Arthur Dent

problem with that is that then i need to plan ahead how many images per
line, and then do a whole mess of conditional processing on the
separatoritemtemplate to close the the tr tags after x# of images go buy,
and keep a counter for each image incremented, modding to determine row
lengths. etc. not that its hard, its just a LOT of very tedious code.
 
T

Tony Bukres

Problem with divs is that i need the images to all be on one line until they
fill it, then wrap.
Divs always want to wrap, which would put each image on a new line.

I thought about tables, but trying to do tables in a repeater is so
cumbersome. I had hoped id
be able to simply pad the images. I mean, the docs all say that you can, ...
i guess its just
another case of "We dont care what the doc says, well do what we want"?


See if 'float' helps.

Tony
 
A

Arthur Dent

I tried wrapping them in spans already, also tried wrapping in a label tag.
Also tried adding the padding/margins to the A tag.

How do i set a div to not page-break? I tried style="page-break-after: ;
page-break-before: ;"
but that didnt work. The doc says an empty-string for these settings turns
it off, but apparently
it does not.

Imagine each letter X is an image, i need to do something like the diagram
below, where the number
of images across the page is determined by how wide the images are:


X X X X X X

X X X X X

X X X X X X X

X X X X X X
 
A

Arthur Dent

Ah, THANK YOU!. Adding the float style to the img tag, and moving all my
padding on to the img also did exactly what i needed.

Thanks Very Much!
 
E

Eliyahu Goldin

Put it in a div and apply styles to the div. Or use tables. Hard to say what
is better without seeing what you have on the page.

Eliyahu
 
E

Eliyahu Goldin

I thought about tables, but trying to do tables in a repeater is so
cumbersome.

Easy.

<table>
<asp:repeater>
<itemtemplate>
<tr>
<td style="set your style here"><a href=abc><img src=xyz></a>
</td>
</tr>
</itemtemplate>
</asp:repeater>
</table/

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top