CreateaFreeWebsite  with Responsive Tables

General

 

9 Step Tutor

Background Images in Responsive Tables

Background images can be placed in tables using embedded style sheets and by making use of class identifiers.

background-image: url(images/image.gif);

Tags that accept the background-image attribute are:
<table>
<th>
<td>

We'll use these images in our demonstration:
background image background image background image

Heading
Column 1 Column 2

The HTML

<table class="red-table">
<tr>
<th colspan="2">Heading</th></tr>
<tr>
<td class="left-column">Column 1</td>
<td class="right-column">Column 1</td>
</tr></table>

The CSS

table.red-table{
width: 100%; 
margin: 2% auto;
box-shadow: 1px 1px 2px #000
}

table.red-table th {
background-image: url(images/150-culttext.jpg);
text-align :center;
padding: 5px 5px
}

.left-column {
background-image:url(images/sandy-green.jpg);
text-align :center;
padding : 5px 5px
}


.right-column {
background-image:url(images/sandy-red.jpg);
text-align :center;
padding : 5px 5px
}

 

The techniques used here for making responsive tables is only to be used for the very small ones. For large data tables visit our beginner solution for large responsive data tables.

When using background images in tables or as page backgrounds, be sure to choose them wisely. One of the most common errors in web page design is the use of busy or dark colored backgrounds that conflict with text.

 

Free Tools and Resources We Recommend

Free Responsive Web Design Certification freeCodeCamp
freeCodeCamp is a proven path to your first software developer job.
More than 40,000 people have gotten developer jobs after completing this – including at big companies like Google and Microsoft.
Finally, you'll learn how to make webpages that respond to different screen sizes by building a Twitter card with Flexbox, and a complex blog layout with CSS Grid.
FREE Certification Courses!!
Free Ebook How to Code in HTML5 and CSS3
"How to Code in HTML5 and CSS3" is a free e-book about making websites in HTML5 and CSS for absolute beginners. It doesn't require any experience in IT to start....
FREE HTML Editor (Windows): NoteTab Light
All the features of a commercial HTML editor.
FREE Apache Server (Windows): IndigoAmpp
Set up a real time server environment right on your PC. Test forms and scripts before uploading to your web space.
Linux Users
If like us, you've left the insane world of Microsoft Windows for the even worse experience of Linux, we recommend the BlueFish HTML editor. You'll find it in your software repository. It does have some QUIRKS, but it's FREE.
For image resizing we've found the easiest Linux tool to be Krita.

Have you tried our FREE RWD template kit? Download Template #402 - 6 Page Kit