Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HTML - Draw border around cells

Posted on 2011-09-23
6
Medium Priority
?
395 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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…

721 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