Designer Today - Graphic Design Magazine
Designer Today is the premiere graphic design magazine and tutorial resource for designers

Web Design Tutorials


 


Getting Those Cut Images to Fit in a Table - Web Design Tutorial
Vikki Olds

March 15, 2004

 

1 You've read about cutting your larger images for your web pages to help them load faster. You've learned about creating tables and think you have it all scoped out. You create your table and place your images in it only to find that there is space between the cuts that shouldn't be there. Not to worry. The solution is easy.

Below is my cut image in a 2 x 3 table. As you can see the cut edges don't meet making the image broken.

 

 

2 The code for the table above is below:
  • <table border="0" width="500">
    • <tr>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_1x1.gif" width="249" height="119"></font>
      • </td>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_1x2.gif" width="251" height="119"></font>
      • </td>
    • </tr>
    • <tr>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_2x1.gif" width="249" height="164"></font>
      • </td>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_2x2.gif" width="251" height="164"></font>
      • </td>
    • </tr>
    • <tr>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_3x1.gif" width="249" height="117"></font>
      • </td>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_3x2.gif" width="251" height="117"></font>
      • </td>
    • </tr>
  • </table>

 

3 The very simple answer to this circumstance is to specify cellpadding and cellspacing in your table code. In particular in the opening <table> tag.

 

 

4 The code for the corrected table is below.
  • <table border="0" width="500" cellpadding=0 cellspacing=0>
    • <tr>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_1x1.gif" width="249" height="119"></font>
      • </td>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_1x2.gif" width="251" height="119"></font>
      • </td>
    • </tr>
    • <tr>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_2x1.gif" width="249" height="164"></font>
      • </td>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_2x2.gif" width="251" height="164"></font>
      • </td>
    • </tr>
    • <tr>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_3x1.gif" width="249" height="117"></font>
      • </td>
      • <td>
        • <font face="Verdana" size="2">
        • <img border="0" src="Image2_3x2.gif" width="251" height="117"></font>
      • </td>
    • </tr>
  • </table>

 

5 As you can see by the red text indicated above the very simple solution is to add cellpadding=0 and cellspacing=0. This sets the table up so that it knows there should be absolutely no space between cells.

That's all there is to it. What may have seemed like a large problem has a really simple fix. Try it.

Have fun!

 

Copyright 2004, Vikki Olds, All Rights Reserved



Be the first to bookmark or share this

 

 

 



Web Design Tutorial Section

In this section you will find excellent web design tutorials and training, as well as web design tips, tricks, techniques and effects. Our writers work hard to provide free web design training for you! Our tutorials cover several different html editors and many styles and types of web design and programming. Visit the Designer Today resource directory for more web design and web graphics tutorial resources. You can also find more Web Design Tutorials at Tutorials Today.








Designer Today Tutorial CD

Designer Community Forum

Advertise on Designer Today

Search and register domains at 123 Domain Names UK, Domain Name Registration UK
and the
UK Domain Name Registration Centre

Designer Today - The Graphic Design Magazine for 2D and 3D graphic designers Hundreds of graphic design
and graphic design software tutorials, product reviews and design articles for the graphic designer


Graphic Design Articles | Graphic Design Newsletter | Graphic Design Training  
Photoshop Tutorials | Illustrator Tutorials | After Effects Tutorials


Also be sure to visit
Fun Meme Jokes and Humor | Favorite {fvrit} Blog |
Poser World | The Poser Gazette
Favorite Media |
Stock 3D wiki | Statesboro Magazine | Five Million Dots | Small Business Consumer
GMP Savings Store

Privacy Policy | Website Copyright and Terms & Agreement | Contact | Information | Site Map | Advertise | Submissions

DesignerToday.com runs on a Content Management System by GMP Services
Copyright © 1998-2008, GMP Services, Inc. -
Media Publishers of Statesboro Georgia, All Rights Reserved