Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Problem with fixing Table cell height

Reply
Thread Tools

Problem with fixing Table cell height

 
 
quietman
Guest
Posts: n/a
 
      06-03-2004
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><b r><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><b r><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.


 
Reply With Quote
 
 
 
 
Karl Groves
Guest
Posts: n/a
 
      06-03-2004

"quietman" <(E-Mail Removed)> wrote in message
news:c9lu92$541$(E-Mail Removed)...

> 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:
>

<snip>

> 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


 
Reply With Quote
 
 
 
 
chris
Guest
Posts: n/a
 
      06-03-2004
"quietman" <(E-Mail Removed)> schrieb im Newsbeitrag
news:c9lu92$541$(E-Mail Removed)...
> 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


 
Reply With Quote
 
quietman
Guest
Posts: n/a
 
      06-03-2004

"Karl Groves" <(E-Mail Removed)> wrote in message
news:c9m0fh$nd0$(E-Mail Removed)...
>
> "quietman" <(E-Mail Removed)> wrote in message
> news:c9lu92$541$(E-Mail Removed)...
>
> > 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:
> >

> <snip>
>
> > 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.


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.


>
> -Karl



Cheers.


 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      06-03-2004
On Thu, 3 Jun 2004 12:43:50 +1000, quietman
<(E-Mail Removed)> declared in alt.html:

> 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.

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
quietman
Guest
Posts: n/a
 
      06-03-2004
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.
"Mark Parnell" <(E-Mail Removed)> wrote in message
news:rkq4xesjibxv$(E-Mail Removed)...
> On Thu, 3 Jun 2004 12:43:50 +1000, quietman
> <(E-Mail Removed)> declared in alt.html:
>
> > 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.
>
> --
> Mark Parnell
> http://www.clarkecomputers.com.au



 
Reply With Quote
 
Karl Groves
Guest
Posts: n/a
 
      06-03-2004

"quietman" <(E-Mail Removed)> wrote in message
news:c9m5or$822$(E-Mail Removed)...
> 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


 
Reply With Quote
 
quietman
Guest
Posts: n/a
 
      06-03-2004
Karl,

You sir, are unnecessarily rude and a buffoon.

Kindly go and screw yourself.

Have a nice day

"Karl Groves" <(E-Mail Removed)> wrote in message
news:c9m5qk$p9k$(E-Mail Removed)...
>
> "quietman" <(E-Mail Removed)> wrote in message
> news:c9m5or$822$(E-Mail Removed)...
> > 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
>
>



 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      06-03-2004

"quietman" <(E-Mail Removed)> wrote in message
news:c9m6qf$8e8$(E-Mail Removed)...
> 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.
>
> "Karl Groves" <(E-Mail Removed)> wrote in message
> news:c9m5qk$p9k$(E-Mail Removed)...
> >
> > "quietman" <(E-Mail Removed)> wrote in message
> > news:c9m5or$822$(E-Mail Removed)...
> > > 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
> >
> >

>
>



 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      06-03-2004
On Thu, 3 Jun 2004 13:44:12 +1000, quietman
<(E-Mail Removed)> declared in alt.html:

> 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/

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell's offsetHeight not equal to cell's height?? firefox & IE laszlokenez@gmail.com Javascript 2 08-05-2008 10:44 PM
how to get specific cell height without hard-coding a height value laredotornado@zipmail.com HTML 0 08-19-2006 08:13 PM
textbox height = containing cell height - x JC ASP .Net Web Controls 2 08-02-2004 08:28 PM
Stupid table cell height Brian ASP .Net 0 04-07-2004 01:35 PM
Detecting screen.height for use in <Table Height=> john T Javascript 7 02-19-2004 05:46 AM



Advertisments