p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning HTML, XHTML, CSS, and JavaScript (http://p2p.wrox.com/forumdisplay.php?f=541)
-   -   HELP WITH TABLE BORDER!!!! (http://p2p.wrox.com/showthread.php?t=78847)

andypandyrox456 April 4th, 2010 04:01 PM

HELP WITH TABLE BORDER!!!!
 
Hello everyone.
I am currently learning CSS. I created a style sheet for my web site, and one of the things I used CSS for was my table.
The CSS code created a border around my table. However, it didn't create a border around each individual cell. How can I accomplish this?
Here is my CSS code. The first one applies to the table heading, but I don't think that's relevant to my problem. Also, crew was just the name of my table. That's not important to my problem.
Code:

th {
font-weight:bold;
padding:5px;
font-size:25pt;
color:red;
text-decoration:blink;
font-family:Jokerman}

table.Crew {
border-style:outset;
border-width:5px solid;
border-color:gray}


EDIT: Never mind. I figured it out. You just need to use a td CSS.
Can a Wrox moderator delete this thread, since it's of no use?

PeterPeiGuo April 4th, 2010 05:35 PM

here is a simplest example, and there are lots that you can do with CSS:
Code:

<html>
<head>
<style>
table {
        border-style:outset;
        border-width:1px;
        border-color:red;
        border-spacing: 0px;
}
td {
        border-style:outset;
        border-color:red;
        border-width: 1px;
        padding: 10px;
}
</style>
</head>
<body>
<table>
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
</table>
</body>
</html>


andypandyrox456 April 4th, 2010 06:10 PM

Quote:

Originally Posted by PeterPeiGuo (Post 255817)
here is a simplest example, and there are lots that you can do with CSS:
Code:

<html>
<head>
<style>
table {
        border-style:outset;
        border-width:1px;
        border-color:red;
        border-spacing: 0px;
}
td {
        border-style:outset;
        border-color:red;
        border-width: 1px;
        padding: 10px;
}
</style>
</head>
<body>
<table>
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
<tr><td>foo</td><td>foo</td><td>foo</td></tr>
</table>
</body>
</html>


Thanks, but I already figured it out. I didn't use the <td> element in my code, and then I realized that I should've, since it didn't take the place of the table element.


All times are GMT -4. The time now is 10:00 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.