HTML
  Home arrow HTML arrow Page 6 - HTML Tables
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

HTML Tables
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 3
    2008-01-30

    Table of Contents:
  • HTML Tables
  • Headings in Tables
  • Spanning More than One Row or Column
  • Using Tags Inside of Tables
  • Cellpadding and Cellspacing
  • Setting Backgrounds in Tables and Cells
  • Aligning Data within Your Cells

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    HTML Tables - Setting Backgrounds in Tables and Cells


    (Page 6 of 7 )

    Wanna make dem tables pertier? Woo-eee you betcha do. Well you can do so by using the bgcolor attribute to set the color, or the background attribute to set an image for the table's background:


    <html>

    <body>

    <h2>How to Set the Background Color of a Table:</h2>

    <table border="1"

    bgcolor="brown">

    <tr>

    <td>Some</td>

    <td>Text</td>

    </tr>

    </table>

    <h2>How to Set a Background Image in a Table:</h2>

    <table border="1"

    background="somebackground.jpg">

    <tr>

    <td>More</td>

    <td>Text</td>

    </tr>

    </table>

    </body>

    </html>

    The above sets the color of one table, and an image as a background for another table. This is how to set the background color and background image for a cell within a table, as opposed to the entire table:


    <html>

    <body>


    <h4>Cell backgrounds:</h4>

    <table border="1">

    <tr>

    <td bgcolor="yellow">Color</td>

    <td>No Color</td>

    </tr>

    <tr>

    <td

    background="sample.jpg">

    Picture</td>

    <td>No Picture</td>

    </tr>

    </table>


    </body>

    </html>

    The above creates a table with four cells. One cell has a color in it and the cell next to it does not. In the second row, the first cell has an image for a background, while the cell to the right of it does not. Note that it is important to ensure your background (whether it be an image or a color) does not clash with your text. It is also important to ensure that your text is readable on the background that you choose; white text on a white background simply won't do, for example.

    More HTML Articles
    More By James Payne


       · Thanks for stopping by to read my article on HTML tables, where we discuss a...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT