Free Webmasters Resources, Webmaster Tools, CGI Scripts, Web Tutorials, Web Articles  

Dating Services Software
Navigation
Home
Advertise
Webmaster Forums
Webmaster Resources
Webmaster Tools
Web Articles
Tutorials
Free Newsletter

Link To Us
Site Map
About Us
Search
Contact

Webmaster Resources
Resource Home
Submit Resource
Expanded Directory

Commerce
Free Services
Learning
Online Tools
Our Webmaster Tools
Promotion
Scripts
Software
Web Hosting
Website Design


Webmaster Tools
SEO Tools

- Meta Tag Generator
- Google Position Checker
- Keyword Density Analyzer
- Keyword Generator
- Link Popularity Checker
- Meta Tag Analyzer
- Search Index Report
- Search Simulator
- Web Page Analyzer
- Yahoo Position Checker

HTML Tools

- Color Chart
- Color Converter
- Dreamweaver Code Cleaner
- Frontpage Code Cleaner
- HTML Entities List
- Web Page Size Checker

Domain Tools

- Domain Typo Generator
- Whois Lookup

Other Tools

- HTTP Headers Viewer
- IP Address


Free Newsletter
This is a private mailing list and will never be sold or given away for any reason. Newsletter sent out in HTML format.


First Name:


Email Address:




More Information
Archives


Poll
Which Operating system/s do you use?
Windows XP
Windows 2000
Windows ME
Windows 98
Windows 95
Linux
MAC OS
Solaris
Don't Know
 

Results
Past Results


Site Search
Search this entire Website for articles, tutorials, reviews and other resources.


Adv. Search

Scripts & Programs
Submit Script

ASP Scripts
C and C++ Scripts
JavaScripts
Perl and CGI Scripts
PHP Scripts
Remotely Hosted


Web Articles
Submit Article

Coding
eZine Production
Marketing Tips
Online Business
Other Internet Articles
Search Engines
Web Design
Web Hosting


Tutorials
Submit Tutorial

ASP Tutorials
C and C++ Tutorials
ColdFusion Tutorials
DHTML Tutorials
Flash Tutorials
Graphic Tutorials
HTML Tutorials
JavaScript Tutorials
Perl Tutorials
PHP Tutorials
Web Design Tutorials
XML Tutorials


Border Colors For Tables

Home Page :: Authors Login :: Author Signup :: Search :: More Articles

Home :: HTML/CSS


About This Author :: Request Reprint :: Print Article :: Tell A Friend


Border Colors For Tables
By Amit Pujar
amitpujar@yahoo.com
Contact Amit Pujar
http://www.geocities.com/amitpujar

When creating tables in HTML, authors are often limited to creating tables without using the BORDERCOLOR attribute because most browsers do not support it. Only some (and recent) web browsers support the attribute BORDERCOLOR. In browsers that do not support this attribute, the table appears as a grayish line.

For browsers that do, a table with 3D borders is displayed. The attributes BORDERCOLORLIGHT and BORDERCOLORDARK further add to the color of the border. Some browsers, though, do not support these attributes. Some HTML authors use an image to achieve the effect of colored borders to the table.

You can also create tables with colored borders using CSS (Cascading Style Sheets). But not all browsers support the TABLE-BORDER property.

You can overcome this problem by using the BGCOLOR and CELLSPACING attributes to achieve tables with colored borders. You can use the hexadecimal color code for borders.

The BGCOLOR attribute specifies the background color when used with the TABLE element. The CELLSPACING attribute specifies the distance between two adjacent cells in the table.

Use the CELLSPACING attribute to specify the thickness of the table border. Use the BGCOLOR in the TABLE tag to specify the color of the border. Then specify the background color of the page in each row or cell.

For example, consider the following table:


   <TABLE CELLSPACING="1" BGCOLOR="#008800">
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      - (1)
     <TR BGCOLOR="#ffffff">
         ^^^^^^^^^^^^^^^^                       - (2)
        <TD>Data</TD>
        <TD>Data</TD>
        <TD>Data</TD>
        <TD>Data</TD>
     </TR>
   </TABLE>



1. The TABLE element has the attribute and value BGCOLOR="#008800". When a browser interprets this line, it renders the table with #008800 (green) background color. CELLSPACING="1" separates each cell in the table by 1 pixel. The background color shows through this space.

2. The BGCOLOR="#ffffff" is used to give a background color (white) to the row. This attriute can be placed in the <TD> tag as well (<TD BGCOLOR="#ffffff">).

When the browser interprets and displays this code, a white (#ffffff) table with green (#008800) border is seen.

Examples
1. The following table has a red border color that is 1 pixel thick.


<table cellspacing="1" bgcolor="red">
  <tr bgcolor="#ffffff">
     <td>
     This is a single cell
     table whose borders are
     red in color and 1 pixel
     in thickness.
     </td>
  </tr>
</table>



2. The following table has a blue border color that is 2 pixels thick.


<table cellspacing="2" bgcolor="blue" width="250">
  <tr bgcolor="#ffffff">
     <td>
     This is a single cell table whose borders are
     blue in color and 2 pixels in thickness.
     </td>
  </tr>
</table>



3. The following table has a violet border color that is 3 pixels thick.


<table cellspacing="3" bgcolor="violet">
   <tr bgcolor="#ffffff">
      <td colspan="2">
      This is a table whose borders are violet
      in color and 3 pixel in thickness.
      </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td> Cell 1 </td>
      <td> Cell 2 </td>
   </tr>
</table>



4. The following table has a green border color that is 4 pixels thick.


<table cellspacing="4" cellpadding="5" bgcolor="green" width="250">
   <tr bgcolor="#ffffff">
      <td colspan="3">
      This is a table whose borders are
      green in color and 3 pixel in thickness.
      </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td> Cell 1 </td>
      <td> Cell 2 </td>
      <td> Cell 3 </td>
   </tr>
</table>



5. The following table has a #aa6600 border color that is 1 pixel thick.


<table cellspacing="1" cellpadding="5" bgcolor="#aa6600">
      <caption>Travel Expense Report</caption>
   <tr bgcolor="#ffffff">
      <th></th>
      <th>Meals</th>
      <th>Hotels</th>
      <th>Transport</th>
      <td>subtotals</td>
   </tr>
   <tr bgcolor="#ffffff">
      <th>San Jose</th>
      <th> </th>
      <th> </th>
      <th> </th>
      <td> </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td>25-Aug-97</td>
      <td>37.74</td>
      <td>112.00</td>
      <td>45.00</td>
      <td></td>
   </tr>
   <tr bgcolor="#ffffff">
      <td>26-Aug-97</td>
      <td>27.28</td>
      <td>112.00</td>
      <td>45.00</td>
      <td> </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td>subtotals</td>
      <td>65.02</td>
      <td>224.00</td>
      <td>90.00</td>
      <td>379.02</td>
   </tr>
   <tr bgcolor="#ffffff">
      <th>Seattle</th>
      <th> </th>
      <th> </th>
      <th> </th>
      <td> </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td>27-Aug-97</td>
      <td>96.25</td>
      <td>109.00</td>
      <td>36.00</td>
      <td> </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td>28-Aug-97</td>
      <td>35.00</td>
      <td>109.00</td>
      <td>36.00</td>
      <td> </td>
   </tr>
   <tr bgcolor="#ffffff">
      <td>subtotals</td>
      <td>131.25</td>
      <td>218.00</td>
      <td>72.00</td>
      <td>421.25</td>
   </tr>
   <tr bgcolor="#ffffff">
      <th>Totals</th>
      <td>196.27</td>
      <td>442.00</td>
      <td>162.00</td>
      <td>800.27</td>
   </tr>
</table>



Using this method, you can create colored tables for any browser that support tables without having to use the BORDERCOLOR attribute. You do not have to use CSS either to create tables with colored borders.

Discuss this in our Webmaster Forums

About The Author:
Amit Pujar
http://www.geocities.com/amitpujar
Amit Pujar is a technical writer. He has extensive experience in writing and web design. You can reach him at amitpujar@yahoo.com.

Go To Top

This article has been read 88 times.


About This Author :: Request Reprint :: Print Article :: Tell A Friend



Advertising
Advertise your website here. View Advertising Information.

Google Ranking Tool
Search Engine OptimizationGet This Tool Free!

Home   Search   Contact   About Us  

Hot Resources
We have found some of the Hottest Resources around just for you! Check these out:
Search Engine Promotion
- Search engine specialist
- Over 200 clients worldwide
- SEO as low as $499
- Link Building for $150

More info...

Online Dating Script

aeDating 3.0 new version of famous dating software with free installation, lifetime upgrades and technical support. New templates, private photos, credits payment system, integrated with phpBB, banner system, new IM.

Visit resource

Web Hosting!
- Free web hosting
- Web site hosting
- Reseller hosting

Search Engine Placement
Since 1997 StepForth has been a result and client oriented search engine optimization and placement company. Our SEO services are guaranteed and proven. Questions? Contact us: 1-877-385-5526

More info...

Best Web Hosting!
- LunarPages ($7.95)
- iPowerWeb ($7.95)
- Globat ($7.50)
- PowWeb ($7.77)

WebHosting $7.50/mo
$7.50/mo - 1000 MB Space, 40 GB Transfer, 24/7 Support, 99.9% Uptime, FREE Domain and FREE Setup.

More info...


Sponsors
Web Hosting
Web Hosting India
StartLogic
Web Hosting
Cheap Web Hosting

Search Engines
Search Engine Optimization SEO
NetVisits Web Directory
Search Engine Optimization

Webmaster Tools
Webmaster Resources

Software
MAS 90

Domain Names
Resell Domain Names and More!

Link Popularity
Reciprocal Link Exchange Directory
Link Building Campaigns

Great Deals
Cheap Flights
Cheap Car Rental
Cheap Mobile Phones
Plasma Televisions



Partners
Cheap Web Hosting
Free Web Hosting
Free URL Redirection
Dreamweaver Web Templates
Domain Name Forums
Website Advertising
Php Scripts
Cheap Web Hosting
Cheap Web Host
Free Webmaster Resources
Need CGI
Desro Webmaster Resources
Web-Mastery Web-Resources
Top 10 Hosts - PHP MySQL

Books
HTML for the World Wide Web with XHTML and CSS

HTML for the World Wide Web with XHTML and CSS


Recommended Web Host

Contact Information
SurfSpeedy

Powered by Outasight Enterprises Pty Ltd
PO Box 1218 Mudgeeraba QLD 4213 AUS
All content � Webmaster Resources 101, 2002-2004 unless otherwise stated.
Design by OE Design Hosted by Surf Speedy View our Privacy Policy
Page loaded in 4.220 secs.
5 users online.

The Hottest Reseller Program Going!