Solved

HTML - Draw border around cells

Posted on 2011-09-23
6
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 83

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
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!

 
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

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…

726 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