Wrox Programmer Forums
|
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 4th, 2010, 04:01 PM
Registered User
 
Join Date: Apr 2010
Posts: 70
Thanks: 4
Thanked 0 Times in 0 Posts
Default 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?

Last edited by andypandyrox456; April 4th, 2010 at 04:07 PM..
 
Old April 4th, 2010, 05:35 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

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>
 
Old April 4th, 2010, 06:10 PM
Registered User
 
Join Date: Apr 2010
Posts: 70
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change border color for every cell of a table jdang67 CSS Cascading Style Sheets 10 May 6th, 2010 12:21 AM
Extending vertical border to another border olivaw CSS Cascading Style Sheets 5 March 16th, 2010 05:57 AM
CSS for Table border. rupen CSS Cascading Style Sheets 2 March 29th, 2006 09:41 AM
Table and border mani_he Javascript 6 January 4th, 2005 05:27 PM
static HTML table border problem Robin1 HTML Code Clinic 4 August 12th, 2004 04:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.