Solved

CSS borders

Posted on 2010-11-29
6
277 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 100 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 100 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 200 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
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!

 
LVL 8

Assisted Solution

by:Zado
Zado earned 100 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Date on a table 16 36
Sending ASP to server side 8 32
Allow a tab area under the contents 1 25
html form layout 4 36
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
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…

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