</TD> tags

CS 105 Gossip Corner: Discussions related to lab assignments: Questions Regarding Lab 5: HTML Tables: </TD> tags
By
Lichtman, Karen M. (02kml) on Sunday, October 18, 1998 - 11:21 pm:

Is it necessary to type </TD> at the end of every single table item? The "Insert sample table" button only creates <TD> tags.

-Karen


By Tom Murtagh (Admin) on Sunday, October 18, 1998 - 11:27 pm:

I'm a bit confused because when I use "Insert sample table" it does include the </td> tags. Regardless, the short answer to your question is that according to the rules of HTML 3.2, </TD> tags are optional. If you don't like typing them you can just leave them out.

I prefer to include them when I type in HTML for tables because I find they make it a bit easier for me to keep track of what is going on when the nesting gets complicated.

Tom


By Ley, Hilary C. (01hcl) on Monday, October 19, 1998 - 12:52 am:

I am confused by the <td height> tags from the view source page of part 2 of the lab in the table project alternative (the schedule). I tried to make sense of the number values but I remain perplexed. Could you please clarify how height attributes work as they appear in the view source document for your schedule table? Thank you. Hilary

ps - how do you color/shade cells? With and without text??


By Tom Murtagh (Admin) on Monday, October 19, 1998 - 09:04 am:

All of the "height" attributes in my schedule table are associated with TD tags for cells that form a nearly invisible seventh column in the table. This way, they are associated with cells that are not complicated by ROWSPAN attributes. As such, they provide a way to specify row heights unambiguously.

The actual numbers used come from a simple scaling scheme. When I first made the table, I used a scale of 1 pixel of height per minute of time. That is, if a cell corresponded to a full hour, I gave it a height of 60 pixels, fifteen minutes got 15 pixels, etc. This table seemed a bit too spread out. So, I noticed that the smallest time unit I needed to represent was 5 minutes (9:55 to 10:00) and decided to see how the table would look if I instead used 4 pixels for every 5 minutes. This lead to the wierd numbers you saw (48 pixels = 60 minutes, 8 pixels = 10 minutes, etc.). I was happier with the size of the table at this scale.

Tom

P.S. It is not part of the official HTML 3.2 standard, but real browsers recognize an extra attribute named BGCOLOR in TABLE, TR, TH and TD tags. This BGCOLOR attributed works just like the BGCOLOR attributed found in the BODY tag except it only applies to the table (if in the TABLE tag), row (TR tag), or cell (TH or TD) tag it appears within.


By Tan, Katherine (99kt) on Thursday, October 22, 1998 - 02:44 pm:

2 things-
isn't there a way to control the table border color? also, is there a way to control the spacing of text? thanks,kate


By Tom Murtagh (Admin) on Friday, October 23, 1998 - 12:30 pm:

There is no generally supported attribute to directly control the color of a tables border. Microsoft supports such an attribute in IE, but no other browser recognizes it.

I noticed once that the color of a table's border does seem to be influenced by the background color of the area where the table is placed. So, you may be able to get the result you want by placing the "real" table within the one and only cell of a larger table and setting the BGCOLOR for the cell containing your table to the color you want to use for its border.

I'm not quite sure what you mean by spacing of text (leading, kerning...). I would suspect, however that you will find that HTML doesn't really give you as much control as you want. Most of the time, you should just live with HTML's shortcomings. However, if what you are looking for is some sort of fancy heading, the standard solution is to make text that looks the way you want it to with PhotoShop and then include the image containing the text instead of the text.

Tom


Add a Message


This is a private posting area. A valid username and password combination is required to post messages to this discussion.
Username:  
Password:
Post as "Anonymous"