How do I make an outline border around my html tables without putting a border around rows and cells?

I want to put a border around my table, just my table. Everytime I set <table border='1'>, it puts a border around all of the individual cells and rows as well. How can I make a border just around my tables?

Public Comments

  1. Put your real table inside another table with 1 row, 1 col. Set the outer table border, but not the inner table.
  2. use a table inside a table. create a table with one row and one column and a border. then, put your existing table in that table, like this: <table border=1> <tr><td> <!--your existing table here--> </td></tr> </table>
  3. Add this between these tags: <head> <style type="text/css"> table { border:1px solid #000;} </style> </head> Make sure the style tags go between the head tags... that will put a black border around every table on your site... If you want to simply put it on just one table do the following: <head> <style type="text/css"> table.myborder { border:1px solid #000;} </style> </head> Then in your <table> tag like this: <table class="myborder"></table>
  4. You could create wrapper table with cellspacing=0 & cellpadding=0 & border=1 For example: <table cellspacing=0 cellpadding=0 border=1 > <tr><td> <table> ....<!--your table--> </table> </td></tr> </table>
Powered by Yahoo! Answers