Solved

CSS borders

Posted on 2010-11-29
6
272 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

948 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now