Computer Science Canada Tables |
Author: | stef_ios [ Tue Feb 06, 2007 8:18 pm ] |
Post subject: | 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! P.S. I am a noobie at XHTML and even though I know HTML, I have never done a table before. |
Author: | Amailer [ Tue Feb 06, 2007 8:42 pm ] |
Post subject: | RE:Tables |
http://www.w3schools.com/tags/tag_table.asp Check w3schools |
Author: | stef_ios [ Wed Feb 07, 2007 2:24 pm ] |
Post subject: | Re: Tables |
Thanks!! That really did help. I used w3schools before, but i couldn't find that page. Thanks! |
Author: | stef_ios [ Wed Feb 07, 2007 3:01 pm ] | ||
Post subject: | 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.
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! |
Author: | Amailer [ Wed Feb 07, 2007 4:28 pm ] | ||||
Post subject: | RE:Tables | ||||
You CAN just do width="x%" for each <td>, but then it would come up as invalid XHTML. So, you have to use CSS You can make a simple CSS id for TD width like:
and then give that TD that id
Or line in the way they show at w3.org **EDIT** Wow, whats with me and the URL bbcode oO |
Author: | stef_ios [ Wed Feb 07, 2007 4:43 pm ] |
Post subject: | Re: Tables |
Where in the code do I put that first bit of code? I'm not too sure. It's saying dialogue error. |
Author: | Amailer [ Wed Feb 07, 2007 4:51 pm ] | ||||||
Post subject: | RE:Tables | ||||||
You can do it this way, in your <head></head> tags put:
Or you could include a .css file using:
In that (my.css) you just put
|
Author: | stef_ios [ Wed Feb 07, 2007 5:18 pm ] |
Post subject: | 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. |
Author: | Amailer [ Wed Feb 07, 2007 5:44 pm ] |
Post subject: | RE:Tables |
With CSS use background-color: #code; |
Author: | stef_ios [ Wed Feb 07, 2007 5:58 pm ] |
Post subject: | Re: Tables |
How exactly do I do that? I really suck at this stuff |
Author: | Amailer [ Wed Feb 07, 2007 6:15 pm ] |
Post subject: | RE:Tables |
Look up CSS background-color on google For background images, background-image: |
Author: | stef_ios [ Thu Feb 08, 2007 5:13 pm ] | ||
Post subject: | 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.
I do not understand what the validator is telling me. Can someone please explain? |
Author: | rdrake [ Thu Feb 08, 2007 5:54 pm ] | ||
Post subject: | Re: Tables | ||
You must close all of your tags, like so:
|
Author: | Amailer [ Thu Feb 08, 2007 9:26 pm ] | ||
Post subject: | 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 you could have just put it right into the html) |
Author: | stef_ios [ Fri Feb 09, 2007 3:59 pm ] |
Post subject: | Re: Tables |
Thanks for all the help!! It passed the validation!! Yay! Thanks alot!! |