HTML Table Background Images with CSS

Use CSS background-image to place a decorative background behind an HTML table or cell. The historical HTML background attribute on <table> and <td> should not be used in modern pages.

Background image on a table Top ↑

<table class="photo-table">
  <tr><td>Cell 1</td><td>Cell 2</td></tr>
</table>

.photo-table {
  background-image: url("images/bg1.jpg");
  background-repeat: repeat;
}
Cell 1Cell 2
Cell 3Cell 4

Background on one cell Top ↑

Apply a class to a particular <td> when only one cell needs the image. Keep table markup focused on tabular data and presentation in CSS.

Useful background properties Top ↑

Depending on the design, combine background-image with background-repeat, background-position, background-size and a fallback background-color.

Protect data readability Top ↑

A decorative image must not make table text difficult to read. Maintain sufficient contrast and avoid busy images behind important data. Background images also have no useful alternative-text mechanism, so do not use them to communicate essential information.

Original table background demo HTML tables Gradient tutorial





plus2net.com







andy

07-12-2014

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
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer