
-----------------------------------
stef_ios
Tue Feb 06, 2007 8:18 pm

Tables
-----------------------------------
I am writing in XHTML and I do not know how to write code for a table. It is three rows and three columns, and there is writing in each cell. If someone could help get me started that would be great. Thanks!  :D 

P.S. I am a noobie at XHTML and even though I know HTML, I have never done a table before.  :?

-----------------------------------
Amailer
Tue Feb 06, 2007 8:42 pm

RE:Tables
-----------------------------------
http://www.w3schools.com/tags/tag_table.asp

Check w3schools :D

-----------------------------------
stef_ios
Wed Feb 07, 2007 2:24 pm

Re: Tables
-----------------------------------
Thanks!! That really did help. I used w3schools before, but i couldn't find that page.  :? Thanks!  :D

-----------------------------------
stef_ios
Wed Feb 07, 2007 3:01 pm

Re: Tables
-----------------------------------
Ok, another question now. Here is my code. Now the problem I am running into is that I cannot get the cells spaced out. This is my code. 






	Mr. Henrich's Class Schedule




Mr. Henrich's Class Schedule


	
		Class
		Room
		Time
	
	
		GLC201-01
		1st Floor, Room 101
		8:25 AM to 9:45 AM
	
	
		ICE4M1-01
		2nd Floor, Room 224
		12:10 PM to 1:25 PM
	
	
		ICS4M1-01
		2nd Floor, Room 224
		12:10 PM to 1:25 PM
	
	
		ICE3M1-01
		2nd Floor, Room 224
		1:25 PM to 2:45 PM
	







I don't know what the code looks like to make the cells longer horizontally. They are stubby little boxes right now. Also, I do not know how to get the cell borders to have their own colour. The colour should be #000000 for the text and #FF1493 for the border. I do not know how to chang ethe colour of the border though. I cannot find the code for those two parts either, so any help I can get would be great! Thanks!

-----------------------------------
Amailer
Wed Feb 07, 2007 4:28 pm

RE:Tables
-----------------------------------
You CAN just do width="x%" for each , but then it would come up as invalid XHTML. So, you have to use #width10 {
width: 10px;
}

and then give that TD that id
...

Or line in the way they show at w3.org :D

**EDIT** Wow, whats with me and the URL bbcode oO

-----------------------------------
stef_ios
Wed Feb 07, 2007 4:43 pm

Re: Tables
-----------------------------------
Where in the code do I put that first bit of code? I'm not too sure. It's saying dialogue error.

-----------------------------------
Amailer
Wed Feb 07, 2007 4:51 pm

RE:Tables
-----------------------------------
You can do it this way, in your  tags put:

#width10 {
width: 10px;
}



Or you could include a .css file using:


In that (my.css) you just put
#width10 {
width: 10px;
} 

-----------------------------------
stef_ios
Wed Feb 07, 2007 5:18 pm

Re: Tables
-----------------------------------
Another question now. So the background colour is perfect. But now I need to make the border colour of the cells different. The bottom and right borders of each cell are red, and the top and left borders are black. How do I do this, because w3schools doesn't say. Thanks.

-----------------------------------
Amailer
Wed Feb 07, 2007 5:44 pm

RE:Tables
-----------------------------------
With CSS use background-color: #code;

-----------------------------------
stef_ios
Wed Feb 07, 2007 5:58 pm

Re: Tables
-----------------------------------
How exactly do I do that? I really suck at this stuff  :?   :(

-----------------------------------
Amailer
Wed Feb 07, 2007 6:15 pm

RE:Tables
-----------------------------------
Look up CSS background-color on google :D For background images, background-image:

-----------------------------------
stef_ios
Thu Feb 08, 2007 5:13 pm

Re: Tables
-----------------------------------
I have another table now. For this one I can't seem to get it to pass the validation at http://validator.w3.org. Here is the code.






	My Very Own Table!

 
#width950 { 
width: 950px; 
border-style: solid;
border-color: #FFFFFF;
color: #FFFFFF;
}

 





Immigration and Emigration (1981-2001 Censuses)


	
		Year
				
		Immigration
				
		Emigration
				
	
	
		1981-1986
		678
		278
	
	
		1986-1991
		1,164
		213
	
	
		1991-1996
		1,118
		338
	
	
		1996-2001
		1,217
		376
	







I do not understand what the validator is telling me. Can someone please explain?

-----------------------------------
rdrake
Thu Feb 08, 2007 5:54 pm

Re: Tables
-----------------------------------
You must close all of your tags, like so:	
	Year
				Notice how I placed the " />" at the end of the image tag, and added the < / a > tag after the end of your image tag?  It should now be valid, though I did not test it yet.

-----------------------------------
Amailer
Thu Feb 08, 2007 9:26 pm

RE:Tables
-----------------------------------
Also I noticed your validating by xhtml1-transitional, so that would allow you to use the bgcolor value (if Im correct, not 100% sure) in your table tags:
 

but if it was strict, that wouldn't be allowed (hm, I always thought you were using strict, sorry xD no need for that css really if you aren't :P you could have just put it right into the html)

-----------------------------------
stef_ios
Fri Feb 09, 2007 3:59 pm

Re: Tables
-----------------------------------
Thanks for all the help!! It passed the validation!! Yay! Thanks alot!!
