Solved

HTML - Draw border around cells

Posted on 2011-09-23
6
387 Views
Last Modified: 2012-05-12
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
Comment
Question by:CipherIS
6 Comments
 
LVL 3

Expert Comment

by:Xenus99
ID: 36591042
Add this to your header

<style>
table, th, td{
border: 1px solid #000000;
}
</style>
0
 
LVL 1

Author Comment

by:CipherIS
ID: 36591069
Nope.  I need it to look like the attached file.
Border.jpg
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 36591322
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 9

Expert Comment

by:user_n
ID: 36591376
0
 
LVL 9

Expert Comment

by:user_n
ID: 36591379
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 36592570
Excellent.  Code was easy to undertand and worked.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now