PDA

View Full Version : Another strange problem and philosophical question


squarkman
07-09-2009, 10:32 PM
You know how when you click on a table and it shows it's width. That always shows but the height is more problematic. Seems I have to dig into the code to find heights. Occasionally they show up in the menu at the bottom but mostly not.
I have some nested tables. Imagine a big table say 4000 in height and the only thing in it is some content at the top 500 in height. Imagine I want to get rid of the excess space at the bottom so I click on the overall table and try to drag it upwards but it will not budge. I would think it MUST move until it hits content. But no.
I'm not interested in comments about not using tables. I have an issue in tables and I want to resolve it and know why it is happening. :)
It would be easier if DW would show the height and width when the table is selected.
Thx

DWcourse
07-09-2009, 10:44 PM
I suspect the problem is that, in addition to having a height specified for the overall table, you have a height specified for one or more cells in the table. You can't shrink the height of the table to be less than the sum of its row heights.

There are good reason for not using the height attribute in a table:
As you're seeing they can be problematic if the heights don't add up.
It's possible to have different heights for cells in the same row but only the larger value "counts."
Height for a table or for table cells can be overruled by the content. Cells/tables expand to accommodate the content they contain.

squarkman
07-09-2009, 11:15 PM
Any content or inner table outline is way less than the overall table. Let's say that theres only one inner table in any colum and these tables are 1/100 of the overall height of the encompassing table (which cannot be dragged up).
An inner table of height 10 surely cannot prevent an encompassing table of 100 from being changed to a height of say 80. right?
Thanks

DWcourse
07-09-2009, 11:18 PM
Are you talking nested tables when you say inner table or do you mean table cells? In any case can you post the table code?

squarkman
07-09-2009, 11:20 PM
If I could transfer an example to you...that would be convenient.

DWcourse
07-09-2009, 11:23 PM
squarkman, I just PMed you.

squarkman
07-09-2009, 11:25 PM
Is that like a forum acronym? Pre-Menstrual, Prime-Ministered, Post-Mortemed? lol
Sorry, I really don't know what that is.

DWcourse
07-09-2009, 11:29 PM
Private message. Click on the link "User CP" in the (blue) forum menu above. The in the left side menu click "List Messages" (about halfway down). My PM should be listed there.

DWcourse
07-10-2009, 12:28 AM
The problem is indeed all of the height attributes you have scattered among the numerous layout tables (and their cells). If you go through and delete the the table and cell height attributes, the height of the tables will "collapse" as you want (I know, I tried it).

Now, the question is should Dreamweaver let you change the height of the tables by clicking and dragging?

The answer is yes and on a well constructed page (even one using tables for layout) it does. But your page is far from well constructed. And it's not really Dreamweaver's fault that all the bells and whistles don't work on a poorly constructed page.

squarkman
07-10-2009, 02:38 AM
While I appreciate your comments, maybe I can rephrase it better. I cannot imagine even the worst spaghetti code, no matter how coded, which would prevent dragging up from the bottom since there is nothing remotely close to the bottom of the table to block the movement. I wouldn't think that making a table shorter in height have anything at all to do with how messy the code is a mile away at the top. If there's room, it should move.
Or I could ask this. What technically speaking tells DW that, "No, this table height cannot be shrunk at all. Somewhere in the mess it is listes as 3999 pixels, and even though there are no physical code objects between 500 and 3999 pixels in that table, it still cannot be moved. Or does messy code cause it to 'lock up'. Can you give me a scenario by which this problem could occur. Or is it in fact not answerable by anything other than "It's too messy."
Thanks, I'm not being glib, just trying to find out why it cannot move, not how I can make it better so it will. Digging for real technical details.
Thanks

squarkman
07-10-2009, 02:59 AM
I have deleted all but the barebones table so it's clear that the code is now not badly written. And it still refuses to allow me to bring the bottom of the table up.
-----------code-------------
<table width="836" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="126" rowspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="550" height="4"></td>
<td width="160" rowspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="4696" valign="top"></td>
</tr>
</table>

--------get this------
I can drag downward to make it larger, no problem. But I cannot drag to make it shorter. ALTHOUGH I can simply change the 4696 in code mode and make is smaller. This tells me it's a DW issue. Do you agree?

DWcourse
07-10-2009, 03:10 AM
Code has to be interpreted. Bad code, just like bad grammar is harder to interpret and even good programs sometimes fail. If you want to find out exactly what the issue is you'll need to go through your code line by line taking out the height attributes one by one. Eventually you may stumble upon the issue. But even then you might not know why because it may be a number of things working together to cause the problem.

My experience is that it's more valuable to know how to avoid a problem than to figure the exact cause of the problem.

In this case, you can avoid the problem by removing the height attributes from your tables and cells. In the future you can avoid it by using good practices while creating pages.

I'm not trying to be glib either, I just can't imagine it being worth anyone's time to figure out the exact cause of the issue when the solution is relatively simple.

DWcourse
07-10-2009, 03:40 AM
I can't believe I did this but:

With your clean code I am able resize the table (at least in CS4) by grabbing the bottom of the table off center (not on the black square handles but on the bottom border - the cursor is a bit different in the two locations).

Going back to your original page, it was possible for me to make the table taller and then shrink it to the original height using the same method. When I made the table taller it was obvious that the blue and red side bars where what was preventing the table from resizing smaller.

So the resizing is not a DW issue, it's your code. The issue with the handles does appear to be a DW issue but you'll have to ask the Adobe programmers about that.

squarkman
07-10-2009, 04:10 AM
I tried what you did and while it will appear to move it up, when I release the left button it pops right back. So you can do it and I cannot. Clearly something wrong with my DW. The code was not the reason I couldnt do it since you could. My point precisely.
Thank you for your time. By the way, I didn't write this code. I'm debating doing it from scratch since it's used as a template.

Corrosive
07-10-2009, 06:39 AM
I tried what you did and while it will appear to move it up, when I release the left button it pops right back. So you can do it and I cannot. Clearly something wrong with my DW. The code was not the reason I couldnt do it since you could. My point precisely.
Thank you for your time. By the way, I didn't write this code. I'm debating doing it from scratch since it's used as a template.


If you are going to start from scratch then drop the tables all together. Learn CSS and div based design and all your issues will just melt away :wink:

squarkman
07-10-2009, 12:39 PM
The refusal of DW to negatively resize the table raised my ire and curiosity. I still don't know why it won't for me but it will for someone else. It's not about how can it be coded better. I want to gain an understanding of what's going on with DW on my system. By the way, have you noticed the tendencie for Div tags to create a space below the content in the Div tag that you can't get rid of such that the next piece of content is effectively moved further down the page than it needs to be?

Corrosive
07-10-2009, 12:44 PM
By the way, have you noticed the tendencie for Div tags to create a space below the content in the Div tag that you can't get rid of such that the next piece of content is effectively moved further down the page than it needs to be?

Errrrr, no. You can style a div tag and the content within it exactly how you need it using CSS. That is the beauty of it so you are doing something wrong.

Something else is causing this to happen. Maybe you have some empty <p> tags as they have pre-determined styles, particularly margins, which may be pushing your div down further than you want it.

squarkman
07-10-2009, 01:31 PM
Not what I'm saying. It happens like this. I creat some text formatted in CSS in a Div statement. I put an image directly beneath it such that the text and the top of the image should be almost touching. The picture ends up an inch belowt the text. That's the kind of thing I'm talking about. The only fix I know is to use layers so they overlap and then getting them close is not an issue. I don't think there is a perfect solution for all needs.

squarkman
07-10-2009, 01:32 PM
Oh, Dreamweaver sucks wiith CSS. That's why when you look at some code you see a string of style statements one after the other. Am I right?

Corrosive
07-10-2009, 01:42 PM
Oh, Dreamweaver sucks wiith CSS. That's why when you look at some code you see a string of style statements one after the other. Am I right?

Dreamweaver is only as good as the person using it. Bad workman and all that. You have to understand HTML and CSS to use it effectively. It is just a labour saving tool and won't build your website for you.

The issue you are encountering with images and text MUST be being controlled by something in your code or they would sit together quite happily.

DWcourse
07-10-2009, 02:33 PM
Am I right?
Sorry but no.

domedia
07-10-2009, 03:29 PM
In any case, you should be able to define how DW writes code if you don't like it.