No duplicate image in tabular data (td)

Is it possible to stop repeating the background image in tabular data (TD) without CSS?

for example

<table> <tr> <td background="http://foobar.com/image.jpg">Some text</td> </tr> </table> 

I am looking for an HTML solution because I am developing an HTML template that will be used for newsletters .

+8
html html-email
source share
4 answers

You can add css to your tag directly in the html code:

 <td style="background-image:url(smile.gif); background-repeat:repeat;"> 

I think there is no way to do this simply using html!

+9
source share

The simple answer is no.

Fortunately, most letters you can use the built-in css-style. So I'll try the following and see if it does what you are looking for.

 <td style="background:url(http://foobar.com/image.jpg) no-repeat;">Some text</td> 

In the event of a crash (as I saw earlier), you are just another option to put the image in the <img> tag and manipulate it so that it falls under the text.

See here for supported CSS attributes: http://www.campaignmonitor.com/css/

Hope this helps.

+4
source share

For maximum compatibility, you should use both embedded CSS and the HTML background attribute, as some clients ignore one and not the other.

 <td style="background-image:url('http://www.example.com/smile.gif'); background-repeat:no-repeat;" background="http://www.example.com/smile.gif">Some text</td> 

Some notes:

  • You must use an absolute URL for the src image
  • The quotes around the URL in the inline background image style should be there (the opposite of the usual CSS recommendation, but some clients have problems if single quotes are not included.)
  • Do not use CSS shorthand, again some clients will ignore it, although they will parse a long arm. In addition, some will set the background color to # 000000 unless you set the background color in the shortened version.
  • Background images do not work at all in Outlook 2007 unless you are using some pretty excellent Microsoft corporate code. Unfortunately, this code does not stop it from repeating.

The best way to stop repeating is simply to make the image much larger than necessary so that it never repeats.

+3
source share
Background images supported

. Please check this generator: http://backgrounds.cm

If you want the image not to repeat, just add an inline style:

 style="background-repeat: no-repeat;" 

to tags containing a background image.

+2
source share

All Articles