Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

HTML - Draw border around cells

How do you draw a border aournd cells so it looks like Excel (no 3d just a solid black line)
<table border="1" cellspacing="0" cellpadding="1"> 
<tr>
 <th>Name</th> 
<th>Favorite Color</th> 
</tr>
 <tr> 
<td>Richie</td> 
<td>Red</td> 
</tr> 
<tr> 
<td>Deanna</td> 
<td>Black</td> 
</tr> 
</table>

Open in new window

0
CipherIS
Asked:
CipherIS
1 Solution
 
Xenus99Commented:
Add this to your header

<style>
table, th, td{
border: 1px solid #000000;
}
</style>
0
 
CipherISAuthor Commented:
Nope.  I need it to look like the attached file.
Border.jpg
0
 
Dave BaldwinFixer of ProblemsCommented:
Try this.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Table Border</title>
<style>
table, th, td{
border: 1px solid #000000;
border-collapse:collapse ;
font-family: Arial;
font-size: 12pt;
font-weight: bold;
}
td {padding: 3px;}
</style>

</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr><td>Name</td><td>Color</td></tr>
<tr><td>Riche</td><td>Red</td></tr>
<tr><td>Deanna</td><td>Black</td></tr>
</table>
</body>
</html>

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
user_nCommented:
0
 
CipherISAuthor Commented:
Excellent.  Code was easy to undertand and worked.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now