Home

1. Introduction

2. Basics review

3. WIDTH

4. VALIGN

5. BORDER

6. BGCOLOR

7. CELLSPACING

8. CELLPADDING

9. ALIGN

10. Table manners

11. Editors

12. Summary

13. Exercises



Classes home

HTML Info home

 

BORDER

The BORDER attribute is one of the easiest to learn - it specifies a border width in pixels.

Before code: table with BORDER

   <table border="1" width="100%">
     <tr>
        <td width="20%" valign="top">History..</td>
        <td width="80%" valign="top">Our club..</td>
     </tr>
   </table>

Before results: table with BORDER

History of the club

Our club was founded in 1815 by Josiah "Bite and Fight" Hastings. Its first meeting was held in the Corn Crib tavern, and drew a dozen prospective members and two dozen police officers.

After several hours of tense negotiations and relaxed vice laws, three dozen new members were added to the club.

After code: table without BORDER

   <table width="100%" border="0">
     <tr>
        <td width="20%" valign="top">History..</td>
        <td width="80%" valign="top">Our club..</td>
     </tr>
   </table>

After results: table without BORDER

History of the club

Our club was founded in 1815 by Josiah "Bite and Fight" Hastings. Its first meeting was held in the Corn Crib tavern, and drew a dozen prospective members and two dozen police officers.

After several hours of tense negotiations and relaxed vice laws, three dozen new members were added to the club.

Note 1: If BORDER remains unspecified, most browsers will not display a border. However since this is a default option, it is always better to specify as BORDER="0" if you want a borderless table.

Note 2: Probably 80% of professional web sites are laid out with borderless tables (this page is, also). It's a very common technique. Designers typically leave BORDER="1" for layout, and then switch to a value of 0 to preview their work.