homepage Welcome to WebmasterWorld Guest from 54.161.166.171
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
TD height="100%": Does this work?
make a cell extend the full height of the table, not just its own contents
dragonlady7




msg:563405
 8:11 pm on Jul 11, 2003 (gmt 0)

My page layout is getting increasingly complex and I'm wishing I'd bothered to learn CSS first. But. The problem is mostly that my boss keeps changing his mind about what he wants. (I will not rant. I will not rant. I am fine. Deep cleansing breaths.)
So. I'm using Dreamweaver MX, if that matters (Code and Design Views together, and editing from both), with a layout made up of nested tables. Lots, and lots, of nests. It was simple when I started, honestly.
What I have is this: a menu at the left of the screen, with expandable (javascript/DHTML) menu entries, sitting in a table inside a table cell. The rest of the page is in the rest of the table cell's larger table. In the middle is the main page content, and at the right, the boss just had me add another table cell with product features and the like-- little lists of things. A narrow cell that he promises will be filled with goodies on every one of our 100 pages.
To make it stand out, he had me put a border around the table inside that table cell. (He wanted to use frames. I gently [webmasterworld.com] talked him [webmasterworld.com] out of it.)
Now he wants me to put a border around the menu on the left.
But when I do, it fails to extend to the bottom of the table. Because, of course, the cell's contents don't take up as much space, so the cell is smaller.
I tried setting the height of that cell to equal 100%. It had no effect.
Is it that I haven't done it right, or is it that that isn't the way to do it at all? There could conceivably be errors in my code, but I figured before I went blind trying to find them (it's so messy. It makes me weep. My code was lovely but I just didn't factor in The Boss Changing His Mind, and it's grown horrible now) I'd ask to see if that was how I should even be going about that.
Thanks in advance for any help anyone can give me...

Mods, you can delink anything that I shouldn't link to; I was just trying to illustrate that I do do my homework occasionally. ^.^

[edited by: tedster at 8:27 pm (utc) on July 11, 2003]

 

hartlandcat




msg:563406
 9:03 pm on Jul 11, 2003 (gmt 0)

Simply and realistically...
I suggest that you completely start again using CSS.

dragonlady7




msg:563407
 9:18 pm on Jul 11, 2003 (gmt 0)

But I CAN'T.
The site is 100 pages now.
I was almost freakin' done and he changed his mind AGAIN...
I need to get it done ASAP. I don't know CSS worth beans yet; I'm working on it at home for my own edification, but I haven't gotten very far. I need to finish this thing. I simply cannot start over.

I just need some way of making the table cells at the right and the left extend the full height of the main table. I'm so close...

tedster




msg:563408
 9:43 pm on Jul 11, 2003 (gmt 0)

Then it's probably going to take a hack -- like putting a spacer.gif in the cell to force the dimension you want and remembering to resize that image on any page that's outside the norm.

I've done it and I'm not proud of it, but it does work. As pages change, the maintenance can get nasty, because I always forget that the spacer gif is there.

moonbiter




msg:563409
 9:48 pm on Jul 11, 2003 (gmt 0)

Why not put a border on the td enclosing the table?

Let me see if I understand correctly. You have a main table with three tds (a,b,c):

-----------
a b c
-----------

In cell (a) you have a nested menu table (1). In cell (c) you have a nested table (2) that is longer than the table in cell (a). When you put a border on table (2), it extends the height of the main table, but when you put a border on table (1) it doesn't.

Is this right?

If so, why not put your borders on cells (a) and (c), and not the enclosed tables? Each of these cells will be the height of the entire main table (which will be as high as it's tallest table cell).

hartlandcat




msg:563410
 10:26 pm on Jul 11, 2003 (gmt 0)

I still don't get why you made a website with over 100 pages for someone without using CSS.

dragonlady7




msg:563411
 12:55 pm on Jul 14, 2003 (gmt 0)

Thank you everyone for your suggestions; I will try them out today and see if I can get any of them to work. I'm so freaking close to finishing this goshdarn project, that if none of these work I shall be forced to turn postal.

>I still don't get why you made a website with over 100 pages for someone without using CSS.

To put it simply, I'm new to webdesign. I'm a technical writer who in the past has made webpages for hobbies. I work for a cheap company that's too dumb to realize it would've been cheaper to hire someone for the project. The boss said don't worry, it's pretty simple. I looked at the old website, said OK, I'd probably better start from scratch because your old WYSIWYG generated the most hideous code I've ever seen. It's a big job, and will probably take me a month. No problem, they said: Here's exactly what we want. No problem-- I could do exactly what they wanted. And did.
Well, they changed their minds about four huge times, so it's dragged on and on. Finally I finished it, and then and only then the boss came by and said "Ok, THIS is what I want" and sprang that last thing on me.
I knew no CSS when I started, and still know very little. I've done several of the "this is my pet cat" kind of websites, and that's all I had to work with, and no time to update my skills. I've done what I could.

We don't all have the time or the resources to follow the latest best practices when we're doing a project, no matter what the W3C may say. I'm also expected to be working on other projects, and now they've said I only have another week to work on this website. I've "finished" it four times now.
I do not have time to teach myself CSS; I have documentation and spec sheets to write. I just have to finish this d**n thing and get it done.

moonbiter




msg:563412
 1:32 pm on Jul 14, 2003 (gmt 0)

If you are using Dreamweaver you might be interested in learning about its templating system [dreamweavermx-templates.com]. Even without CSS, this would make it a whole lot easier for you to do site-wide updates to the page layout.

A Google search for "dreamweaver mx templates tutorial [google.com]" turns up a fair bit of additional material on the templating subject.

dragonlady7




msg:563413
 2:01 pm on Jul 14, 2003 (gmt 0)

I actually am using Dreamweaver's templates, which leads me to a new question.
If I add a new editable region to the template, and then realize that I put it in slightly the wrong place, how can i remove the editable region from the template? I've been trying to do that and haven't been able to. It just screws everything up. Such a pain...
So yes, I can change the whole site at once using a template, but then all of the unique content of each page that's within the reeditable regions has to be edited separately. The template borders also "wiggle", so for instance when I put a reeditable region around the page title so that each page could have its own title, it moved, and the titles were no longer editable but my meta keywords tag was (since their tags were next to each other). I've tried putting comments around the reeditable regions to get them to stop moving, but it hasn't been successful.

So I'm not quite happy with that feature, but flawed as it is, it's saved my life throughout this whole stupid project.
Sigh.

dragonlady7




msg:563414
 2:49 pm on Jul 14, 2003 (gmt 0)

>Each of these cells will be the height of the entire main table (which will be as high as it's tallest table cell)

That's what I figured, and it's not working.

So there must be something wrong with my code, somewhere. I worked so hard in the beginning to make it as clear as possible, but it's just all muddled now. I can't figure out why it's not working. :-(
The boss was so excited when he finally managed to explain what he wanted to me. If only this worked I could make him so happy and he'd leave me alone and I could work on something I understood.
Ah, the terrible pain of life. I'm getting all Goth, now; I'd better just go print out the HTML and pore through it with a hi-liter and figure out what the heck is wrong. Phooey! WebmasterWorld has much advice, but no magic tricks to make it all better.

moonbiter




msg:563415
 3:18 pm on Jul 14, 2003 (gmt 0)

If I add a new editable region to the template, and then realize that I put it in slightly the wrong place, how can i remove the editable region from the template?

I personally haven't used Dreamweaver templates all that much, preferring dynamic includes with php and/or asp. But IIRC, all you have to do is modify the template by:

  1. specify a new editable region where you want it
  2. delete the old editable region
  3. save the template and update the files that use it.
  4. when it pops a dialog about inconsistant region names, simply use the drop down to select the new region you specified.

... when I put a reeditable region around the page title so that each page could have its own title, it moved, ...

That's strange. Are you using the latest version of Mx (6.1)? IIRC, there are issues with templates under 6.0.

Of course, the default html template already has an editable region around the title, so I am wondering why you would add another one ...

dragonlady7




msg:563416
 4:50 pm on Jul 14, 2003 (gmt 0)

> the default html template already has an editable region around the title

Mmm... mine didn't. I created a half-dozen pages before I noticed it, and had to go back and add it in. I didn't know much about Dreamweaver at this point, so I can't remember what template I used to start from. It also lacked a valid DOCTYPE declaration, so I had to add that in as well, which struck me as odd. It's possible that in my total ignorance of Dreamweaver I used some kind of nonstandard template? I have no idea at this point.

>Are you using the latest version of Mx (6.1)?

No. I bought it and downloaded whatever updates I could find, and it's still 6.0. Do I have to pay to upgrade it? I wasn't able to find any reference to that anywhere else. I guess I'll go poke around Macromedia's website; as it is I can't fix the damage that's been done because it's fine on the template page, but there's duplicated code on the subsidiary pages in non-editable regions, so I can't remove the reduplicated code that should be inside the editable region but is not (but is in the template... the only place where I can edit it). I don't want to strip out the template and replace it with a new one for fear of making an even bigger mess...

Argh, my boss stopped by and he seems to think I'm just stalling. I cannot make him understand how hard this is for me!

dragonlady7




msg:563417
 5:51 pm on Jul 14, 2003 (gmt 0)

>why not put your borders on cells

I figured it out. Thank you all.
Here's the problem:
You can't put borders on table cells. That doesn't work. You can only put a border on a whole table, and the table is only as large as its contents. That's what wasn't working, in part. I waded through all my HTML code and flagged every stinking open table tag, and close table tag, to see if anything was wrong, and couldn't figure it out.
But you can change the background color. The boss (fortunately) changed his mind again, and that's what he wants now.
You could probably work around the border thing by using a graphic for the background of the table cell and sizing it to 100% or whatever you needed-- I haven't tested that but it would probably work.
I can change the background color of the table cells, and it works. It seems to carry through to the internal tables as well. But I'm not convinced that it'll work in all the browsers. So there I'll use CSS (what little I know, I know I'm hopeless) and make the table cell have a class with a different background color. (I already had a class for the side menu to make the links a different color, so no biggie to add to it.)

So that's the solution, and now my boss will love me and give me more money. Right? Well, no. But it's the solution at least.
No glory, but I'd rather have a steady paycheck than glory. I guess.

Out of curiosity, how would you put a border around a CSS-structured "table cell"? I'm going to do some research for my own edification on structural CSS (just got a new computer, and am going to use it to put together a fabulous new personal website!) but I haven't gotten around to it yet. (Apple's developer website has a great link to an introduction to structural CSS that I haven't had a chance to read yet. I'd post the URL but I'm pretty lazy and am supposed to be implementing the changes to the website now.)

Thanks, everybody! And, I'll be back, here and in the CSS forum, in the near future. :-)
I feel so smart. ^.^

moonbiter




msg:563418
 8:40 pm on Jul 14, 2003 (gmt 0)

Do I have to pay to upgrade it?

No, Dreamweaver MX 6.1 is a free update [macromedia.com].

Out of curiosity, how would you put a border around a CSS-structured "table cell"?

td { border-width [w3.org]: 1px; border-style [w3.org]: solid; border-color [w3.org]: #000 }

Would give you a 1px solid black border on all your table cells. You can shorthand [w3.org] it further as:

td { border [w3.org]: 1px solid #000 }

To apply it to a specific cell you would put an id on it like <td id="foo"> and then call it with td#foo [w3.org]. If you have several cells with the same attribute, you would class it (<td class="foo">) and call it with td.foo [w3.org].

dragonlady7




msg:563419
 8:55 pm on Jul 14, 2003 (gmt 0)

Ah, thank you _very_ much. I have been under lots of pressure all day and haven't had time to search for that. Oh, crap, it's nearly 5. Jeez...
And thanks for the CSS tips. When I have some time at home I'm planning on learning all this stuff-- "free time" at work has been shrinking lately... I'll ask another dumb question, since you're forthcoming-- I'm trying to get the background color of the table cell set to a color. I can do that by writing the stylesheet like this:
.classside {
background : #E0E0E0;
}

How do I apply that to the entirety of the contents of the class (tables, trs, tds?)-- I'm calling the class by <td class="classside">.
Am I on the right track here? In Dreamweaver's preview window (which is generally wrong) it works, but not in IE or Mozilla. Am I on the right track, or should i just give up, go home and read the entire CSS1 Spec that I printed out for future reference but barely skimmed? (In My Copious Free Time.)

No need to actually answer, as I'm wavering off-topic now for this forum, but that's the level I'm at: CSS moron and HTML Novice. I just don't have time to get a proper handle on this. I learn just enough to do what I need to, and then I forget everything in three days! It's very frustrating, and the most annoying part of doing the job of 3 people. (This was a 4 person department and they fired the manager, didn't replace her, and hired me right out of college to become the all-purpose lackey. So I'm 50% of this whole department, me and another bewildered junior employee. Yow.)

moonbiter




msg:563420
 11:07 pm on Jul 14, 2003 (gmt 0)

How do I apply that to the entirety of the contents of the class (tables, trs, tds?)-- I'm calling the class by <td class="classside">

If I understand your question correctly, you would do it using Descendent selectors [w3.org]. So your selector for the class would be:

.classside table { /* style */ }
.classside tr { /* style */ }
.classside td { /* style */ }

If they are all the same style, you can group them like this:

.classside table, .classside tr, .classside td { /* style */ }

dragonlady7




msg:563421
 2:08 pm on Jul 15, 2003 (gmt 0)

Thank you.
>If I understand your question correctly, you would do it using Descendent selectors.

I get the idea, it's just so helpful to see it written out in one place without sifting through all kinds of other things that I'm not using right now. I just haven't had time to sort out what goes where, and write it down in my own style so I can reference it again. There's never time to do anything properly, so you end up having to re-learn it every time you use it. Blah, I'm so tired of this job and I've only been here half a year! I hope it gets easier. :-)
So, thank you very, very much, and I'll try to do my homework next time before posting a question. It's hard to take time out for homework when the boss is hovering because he wants the project done right now... I'm glad he's taking an interest instead of forgetting I work here (it's only so long before they forget why they pay you, once they forget you're there), but I wish he'd go away for about a day while I make sure I actually know what I'm doing here. ^.^

moonbiter




msg:563422
 2:15 pm on Jul 15, 2003 (gmt 0)

So, thank you very, very much,

That's what were all here for, to learn from each other and point out resources that might be of use to everyone.

IanKelley




msg:563423
 8:34 am on Jul 16, 2003 (gmt 0)

I may have skimmed too quickly and missed that this was already answered but...

You can use height="100%". It's not officially valid HTML (for some incomprehensible reason) but it works fine in IE 5+.

Which, incidently, is used by over 95% of the vistors to a high traffic site I was just looking through the stats for... and over 93% of a site I was looking at yesterday. :-)

If you can come up with something that looks passable in the remaining 5-10%, using height="100%" isn't a problem.

dragonlady7




msg:563424
 6:33 pm on Jul 16, 2003 (gmt 0)

>height="100%"

It didn't work, actually. I'm not sure why, and that's what led me to deconstruct my entire page design, but I couldn't do it. It was 100% of itself, not of the parent element containing it. So... it wasn't doing any good. I just couldn't figure out where the top-level element was.
Table layout doesn't work so well for me. I think I'm a good candidate for switching to CSS... if I can ever master it! Mostly, I need to grow a brain.
:) *does the Wizard of Oz scarecrow dance*

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved