Problem with fixing Table cell height

Q

quietman

Hello all, and here is my problem.

<html>
<head>
<title>Title</title>
</head>
<body>
<table width="748" border="1" cellspacing="0" cellpadding="0"
bgcolor="#FFFFFF" height="295">
<tr>
<td width="374" height="14" colspan="2" valign="top">This cell must
remain at this height</td>
<td width="374" colspan="2" rowspan="2" valign="top" height="293">Main
site content here</td>
</tr>
<tr>
<td width="187" colspan="2" valign="top" height="277">More images/text
here</td>
</tr>
</table>
</body>
</html>

All works well with the cell containing, 'This cell must remain at this
height' until I begin adding a lot of content to cell containing 'Main site
content here'. If I add a lot of content such as:

<html>
<head>
<title>Title</title>
</head>
<body>
<table width="748" border="1" cellspacing="0" cellpadding="0"
bgcolor="#FFFFFF" height="295">
<tr>
<td width="374" height="14" colspan="2" valign="top">This cell must
remain at this height</td>
<td width="374" colspan="2" rowspan="2" valign="top" height="293">Main
site content
here<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br></td>
</tr>
<tr>
<td width="187" colspan="2" valign="top" height="277">More images/text
here</td>
</tr>
</table>
</body>
</html>

you can see how the top left hand cell begins to crawl down the page.No
matter what I do, I cannot 'lock' the height of this cell. I do not want it
to grow.

Please offer some help if you have a solution.

Thnak you.
 
K

Karl Groves

All works well with the cell containing, 'This cell must remain at this
height' until I begin adding a lot of content to cell containing 'Main site
content here'. If I add a lot of content such as:
you can see how the top left hand cell begins to crawl down the page.No
matter what I do, I cannot 'lock' the height of this cell. I do not want it
to grow.

Please offer some help if you have a solution.

The solution is to stop creating the problem.
First and foremost is the fact that you're using tables for layout.
Second is that you're attempting to fix a cell's size.
Third is that you're saying something is a "problem" when the table cells
are doing exactly what they're supposed to be doing.

-Karl
 
C

chris

quietman said:
Hello all, and here is my problem.

<html>
<head>
.....

you can see how the top left hand cell begins to crawl down the page.No
matter what I do, I cannot 'lock' the height of this cell. I do not want it
to grow.

Please offer some help if you have a solution.

Thnak you.


The CSS "table-layout: fixed" might be what you re looking for. The content
will be cut off if it doesnt fit the cells. Might not be a good idea using
this.
chris
 
Q

quietman

Thanks for the reply....
The solution is to stop creating the problem.

Agreed. A good credo for all the problems of the world as well. Very
philosophic.
First and foremost is the fact that you're using tables for layout.

Can and would you suggest an alternative please?
Second is that you're attempting to fix a cell's size.

Agreed. Is there anyway to fix a cell's height?
Third is that you're saying something is a "problem" when the table cells
are doing exactly what they're supposed to be doing.

Which would be? (other than the obvious of expanding to contain their
content), there is only one line of content in the cell in question. It's
height does not need to expand to accommodate it.



Cheers.
 
M

Mark Parnell

Can and would you suggest an alternative please?
http://www.allmyfaqs.com/faq.pl?Tableless_layouts

Agreed. Is there anyway to fix a cell's height?

Agreed that you are creating a problem by trying to achieve that? And
the answer is no.
Which would be? (other than the obvious of expanding to contain their
content),

That's exactly what he's talking about. That's what you are complaining
about. To be more exact, it is the table row expanding - the row expands
to fit the highest cell, and the other cells expand to be the same
height in order to fill the row.
there is only one line of content in the cell in question. It's
height does not need to expand to accommodate it.

But the cell next to it, in the same row, does need to expand. Therefore
the entire row expands. That's the way tables work.
 
Q

quietman

For those with a similar problem, the answer was to use a nested table.

<html>
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100" valign="top">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100" height="20" bgcolor="#FF0000">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0000FF">&nbsp;</td>
</tr>
</table>
</td>
<td width="500" rowspan="2" bgcolor="#00FF00">
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
<p>a</p>
</td>
</tr>
</table>
</body>
</html>

Works perfectly.

Thanks anyway to all.
 
K

Karl Groves

quietman said:
For those with a similar problem, the answer was to use a nested table.

Please do not give any more advice on usenet (or anywhere else) regarding
HTML

-Karl
 
Q

quietman

Karl,

You sir, are unnecessarily rude and a buffoon.

Kindly go and screw yourself.

Have a nice day :)
 
R

rf

quietman said:
Karl,

You sir, are unnecessarily rude and a buffoon.

No matter how much you insult him, he is still correct. Throwing nested
tables at your problem is so last century. Nobody here anymore advises the
use of tables for anything except laying out tabular data (except if the
design simply can not be achieved with CSS, of which yours is not one:
http://users.bigpond.net.au/rf/layout.html ).
Kindly go and screw yourself.

Hmmm. This is not unnecessarily rude?
Have a nice day :)

Thank you sir. I await your next question :)

BTY learn how to post. It's in the FAQ.

Cheers
Richard.
 
M

Mark Parnell

You sir, are unnecessarily rude and a buffoon.

Karl may be rude, but he's certainly not a buffoon. Not when it comes to
HTML, anyway. Can't speak for the rest of the time. :)

Tables are for tabular data. Hence the name. It is extremely rare to
need to nest tables. The content in the code you posted certainly isn't
tabular data, therefore no table is necessary. See the link in my
previous post.

In addition to that, your code contains various other errors which may
or may not get interpreted the way you intend by your visitors browsers.

BTW: Please don't post upside-down
http://www.allmyfaqs.com/faq.pl?How_to_post

This will help:
http://home.in.tum.de/~jain/software/oe-quotefix/
 
Q

quietman

Karl may be rude, but he's certainly not a buffoon. Not when it comes to
HTML, anyway. Can't speak for the rest of the time. :)

Semantics. One goes hand in hand with the other in my book. Look at the
undertones of the majority of his posts. Perhaps 'a pompous ass' would have
been more fitting? Regardless of his intentions, last I looked, common
curtesy cost nothing.
your code contains various other errors which may
or may not get interpreted the way you intend by your visitors browsers.

Indeed and a very quick 'hack' of the solution, but served the purpose for
which it was intended. My situation was very much more involved and
contained more data, images, javascript and mouseover images. The 'solution'
worked perfectly. 'Code' as you call it, is perfectly interpreted by the 4
browsers installed on my PC.

Cheers.
 
M

Mark Parnell

'Code' as you call it, is perfectly interpreted by the 4
browsers installed on my PC.

Well, as long as your visitors use your computer, you'll be fine.

HAND
 
R

rf

Mark Parnell said:
Well, as long as your visitors use your computer, you'll be fine.

Should not "it works on my computer" be wrapped with <aol> and </aol> tags?

Cheers
Richard.
 
Q

quietman

Should not "it works on my computer" be wrapped with <aol> and </aol>
tags?


Either that or <where else could I have a browser installed? Your
place?>and</where else could I have a browser installed? Your place?>

It is to laugh, is it not?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top