Solved

HTML - Draw border around cells

Posted on 2011-09-23
6
388 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 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
2 questions 10 25
Porbably easy CSS question about overlapping and offset images 21 26
Change Background Color of Website 5 16
div to fit another div 8 22
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.
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 receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

770 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