how to add a background image into a table.

  • 1
  • Question
  • Updated 9 years ago
  • Answered
can i add a background image to a table?

Alex
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes

Posted 9 years ago

  • 1
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
yes, Alex you can.

<!--
<TABLE border=1 background="http://mysite.com/resources/imagename...>
<TR>
<TD>one element table</TD>
</TR>
</TABLE>
-->
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
Thanks peter, i will have a go & see what i can do
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
peter, is there a way to edit the size?
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
I was trying to edit the content but it stopped me. I wanted to add that is the basis of the background adding.

There are as many other elements that you need to enhance the table such as border colour, number of cells, width, height, etc.

Once you identify your needs you can ask if you wish or direction if needed for further additions.
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
so the size cant be edited.
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
Sure can. Eitehr dynamically by the content inside or by stating the dimensions.
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
how do i change the dimentions, what code do i put in it & where?
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
Alex,

here's an online table CSS generator which should take you a long way in your design. I haven't used it but it's one of many available. See what you think and if you want any other help lets know.
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
where? theres no link.
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
thanks peter :)
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
Alex were you able to use any of this to create your background containing table?
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
yes, now its working brilliantly
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
This is a typical one element table. The height is dynamic but can be set to a specific height if you wish.

The background image can either be a tiling image or a single image but if a single image then you would have to modify the dimensions to fit the size of your table or modify the dimensions of the table to fit the image size.

<!--
<table border="width of solid border in pixels" bordercolor="#hex number" style="background-image:url(http://yoursite.com/resources/{folder..." : width="put your width in pixles as a number" cellpadding="space in pixels between the edge of your table and the content" cellspacing="2"
align="center, {left. Right. Justified}">
<tr><td>

{Place your content here}

</td>
</tr>
</table>
-->

You can wrap the whole thing in a DIV if you wish.