/    Sign up×
Community /Pin to ProfileBookmark

new line of html equals a space in the browser

Hi there I have a table (1 row , 1 column) that i am lining up some images in ie

[code=html]</table>
<tr>
<td>
<img src=”image1″><img src=”image2″><img src=”image3″><img src=”image4″>
</td>
</tr>
</table>[/code]

However because i have lots and lots of these images sitting next to each other, i would like to tidy up my code like this

[code=html]</table>
<tr>
<td>
<img src=”image1″>
<img src=”image2″>
<img src=”image3″>
<img src=”image4″>
</td>
</tr>
</table>[/code]

But the problem is when i do this , the browser interprets the carriage return between the images as a space and inserts a gap between the images when viewed in the browser.

Is there any way i can tidy up my code in this way without the spaces???

any help would be greatly appreciated
Gary

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonMay 07.2005 — No, a new line in the code will always result in a space, why not simply combine the images into one?
Copy linkTweet thisAlerts:
@hcclnoodlesauthorMay 07.2005 — each image has its own rollover and link so i cant put them into one, thanks anyway for clarifying that...i dont suppose anybody could explain to me how a space for every new line of code is beneficial ?? or is it just a case of "thats how it works so just get on with it" !

I just dont feel like i have total control of the coding when little things like that get in the way, especially from a tidyness perspective
Copy linkTweet thisAlerts:
@felgallMay 07.2005 — Change it to like this to get rid of the spaces (ie move the new lines inside the tags):
&lt;tr&gt;
&lt;td&gt;
&lt;img src="image1"
<i>&gt;</i>&lt;img src="image2"
<i>&gt;</i>&lt;img src="image3"
<i>&gt;</i>&lt;img src="image4"
<i>&gt;</i>&lt;/td&gt;
×

Success!

Help @hcclnoodles spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...