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
Solved

CSS borders

Posted on 2010-11-29
6
276 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
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

791 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