How to add background image to HTML page body elements and tables with repeat and size
We can create attractive headers like modern web design sites using background images. We will use one simple image to create one header like this below. To create one image like this please visit our gradient tutorial in our graphics section.
This is our text over the header
<table width='100%' border='0' cellspacing='1' cellpadding='0' background='images/bg1.jpg'>
<tr><td >This is our text over the header</td></tr>
</table>
Adding Background image to table data cell
This is our text over the header
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
<tr><td background='images/bg1.jpg'>This is our text over the header</td></tr>
</table>
In above script we have added background image directly. We can also use style sheet to display images inside table
Using Style
Globally ( for the page ) we can declare style of the table like this.
All tables of the page will follow this property and all will use the same image as background image.
By adding class to it we can define another style to some other tables.
We will add the above code to head section of the page and display two tables with this.
demo of Table background image with CSS→
Here is the script of the above demo
How can I put different tiling images into a table? I have a 9x9 table, and I want to use the 8 edge cells as the border. I have the corner images sorted (20x20pix), and i have 4 seperate images (20x1 and 1x20) that i need them to extend along the edges. The horizontal ones work, but not the vertical ones. Im using Dreamweaver and CSS. Any suggestions? Thanks
✖
We use cookies to improve your browsing experience. . Learn more