?
Solved

CSS borders

Posted on 2010-11-29
6
Medium Priority
?
279 Views
Last Modified: 2012-05-10
Hi,

I ran following example
<html>
<head>
<style type="text/css">
table,th,td
{
border:1px solid black;
}
</style>
</head>

<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>
</body>
</html>

Open in new window


I have not understood

>>>>>Notice that the table in the example above has double borders. This is because both the table, th, and td elements have separate borders.To display a single border for the table, use the border-collapse property.


please advise. thanks in advance
0
Comment
Question by:gudii9
[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 2

Accepted Solution

by:
getnitincr earned 400 total points
ID: 34236482
I got only a single borde, when using collapse property , border will be lost
0
 
LVL 13

Assisted Solution

by:qwerty021600
qwerty021600 earned 400 total points
ID: 34236483
give this
<style type="text/css">
table,th,td
{
border:1px solid black;
border-collapse: collapse;
}
</style>

it'll work.
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 800 total points
ID: 34245281
The TABLE BORDER is the outside bounding line around the entire table.

The TR -- table row -- borders are the horizontal lines inside the table cells -- all horizontal lines

The TD -- table data -  borders are the vertical lines inside all table cells -- all vertical lines.


http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_borders
http://www.w3schools.com/html/html_tables.asp
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 8

Assisted Solution

by:Zado
Zado earned 400 total points
ID: 34249932
And again, as in previous post, I recommend two main websites to get more info and understand html/css better:
w3schools and w3.org

Read this to learn the borders:
http://www.w3schools.com/css/css_border.asp ,and then this:
http://www.w3.org/TR/CSS2/box.html#border-properties

To learn more advanced techniques for border property, learn what's new in css3 for borders:
http://designshack.co.uk/articles/introduction-to-css3-part-2-borders
0
 
LVL 8

Expert Comment

by:Zado
ID: 34317452
Please grant the points and close the question, thanks :-)
0
 
LVL 8

Expert Comment

by:Zado
ID: 34384862
To be clear here: I'm not asking for grant the points to me, but generally.
If you have a problem with any suggestion from experts or nothing works with your expectation, please let us know, so we will continue work on solution for you, thanks.
0

Featured Post

Industry Leaders: 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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

777 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