Solved

CSS borders

Posted on 2010-11-29
6
270 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
FTP File permissions 1 31
Mobile menu navigation , its html and css 6 39
html input clean up 3 32
HTML CSS 7 21
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
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…

744 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

11 Experts available now in Live!

Get 1:1 Help Now