//, Photoshop/Grunge Tables with Photoshop and XHTML (Part 3)

Grunge Tables with Photoshop and XHTML (Part 3)

Now that you’ve designed your table it’s time to learn how to make it function as valid XHTML. The easiest way is create a hidden table on top of the image.

  1. 1. Create a table with the same number of rows and tables. My image had 8 rows and 9 columns.
  2. 2. So we’ve got our table, now we want to style it with CSS. Give it a div id=””. For the sake of this tutorial of ‘grunge-table’.
  3. 3. In your stylesheet reference the new id and call the image. Don’t forget to include the width and height of your image like so:
  4. <style>
    #grunge_table {
    width:600px;
    height:250px;
    background:url(grunge_table.png) no-repat;
    }
    </style>
    </head>
    
  5. 4. Now, your table isn’t exactly going to match the cells of your image just yet. The best way to make it do this is to figure out the measurements of the columns and rows of your table image in photoshop. If you look at the images below, you’ll see what my table looked like before and after i fixed the columns and rows to match the image.
  6. Before:

    After:

    The Code:

    <table id="grunge_table">
      <tr>
        <td width="192" height="72"> </td>
        <td width="44"> </td>
        <td width="43"> </td>
        <td width="43"> </td>
        <td width="45"> </td>
        <td width="46"> </td>
        <td width="43"> </td>
        <td width="43"> </td>
        <td width="43"> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td height="26"> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td height="24"> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td height="26"> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td height="24"> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
    </table>
    
  7. 5. I used Dreamweaver to give you a visual representation of what’s going on. The green numbers at the bottom of the lower picture show the widths that the columns have been adjusted to. In the lower pic you’ll see that the table now matches the image perfectly.
  8. 6. Now that the dimensions are correct, we need to hide the table setting the border to 0px. Here’s what your stylesheet code should look like:
  9. <style>
    #grunge_table {
    width:600px;
    height:250px;
    border:0px;
    background:url(grunge_table.png) no-repat;
    }
    </style>
    </head>
    

We’ve got our hidden table, in part four we’ll fill it with data.

PART 1 | 2 | 3 | 4

2010-05-25T21:51:16+00:00 May 27th, 2008|HTML, Photoshop|0 Comments

About the Author:

Leave A Comment