• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Image background for html table

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do i make an html table have ONE image
background. i tried this :

<table background="/packA/abc.gif">

</table>

But, the effect is the abc.gif now appears
more than once on the table.
1.How do i make it appear once in the table
background
2.How do i set the height and width attribute of the image.

Cheers All codes and ideas are welcomed.
[ September 30, 2005: Message edited by: Bear Bibeault ]
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just give a try
not sure.
style="background:#EFEEE6 url(images/myimage.jpg) no-repeat"
Regards
Balaji
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello !
Best is to define a CSS for your table
<style type="text/css">
<!--
table {background-image:url(pic/image.png);background-repeat:no-repeat;background-position:bottom}
-->
</style>
You can add the BGPROPERTIES=FIXED in your BODY tag if you want.
Hope that helps
Yann
 
Gabriel Fox
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys , i was able to have an image background . But , how do i stretch the image , that is increase it's width and height. I know the
<IMG> tag has width and height, but this is not
applicable.
All ideas and codes are welcomed.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as far as i know you will have to do that with a paint program.
 
Gabriel Fox
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cheers
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a table
<table style="background:#EFEEE6 url(c:\test1.jpg) no-repeat" width="100%">
how can i stretch or increase the width the image so that it covers the entire table since i dont want to repeat the image

Thanks
Rashid
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. CSS doesn't have the ability to stretch a background image. You might be able to use layered elements to do it, though. You'd create a container element, and put a normal image tag and your table in it. Using z-index, you can move the image behind the table, and set the image to be 100% width and height.

This is untested, but it might get you started:
 
Our first order of business must be this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic