4

I have a response where I have an Image in that response and after every response I need to give a space.How can I do that?

Any help will be appreciated!

Here is my script:

<script type="text/javascript>
    $("#thumbnail").append(response)
</script> 

5 Answers 5

7
<script type="text/javascript>
    $("#thumbnail").append(response +'&nbsp;')
</script>
Sign up to request clarification or add additional context in comments.

4 Comments

Eugh. In 99 out of 100 times, a non-breaking space is a dirty hack and not the right solution.
Why so?, would you please let us know.
Because "space" usually means "margin" or "padding" and not "data"
And the better way can you explain us
1

try this

<script type="text/javascript>
$("#thumbnail").append(response)
$("#thumbnail").append("&nbsp;");
</script> 

Comments

0

Are you looking for the &nbsp; html character? or are you looking to apply a padding or margin?

Comments

0

It depends on what sort of space you want.

Determine what markup and styling you want. Maybe a literal " ", maybe a margin.

Add the appropriate CSS to your stylesheet, then write JS that adds the appropriate markup.

Comments

0

Using css:

#thumbnail img {
   margin-right: yourspace;
}

Comments