HighDots Forums  

100% height of a div inside a TD

alt.html.dhtml alt.html.dhtml


Discuss 100% height of a div inside a TD in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lamberti Fabrizio
 
Posts: n/a

Default 100% height of a div inside a TD - 08-29-2005 , 02:48 AM







I've got the problem described in the table above.

I've put a div red with some text inside a TD, but its height is less than 100% of TD height as you can see.

I've defined the following styles:

div.test { background-color:red; height:100%; width: 100%; }
table.test { border: 1px solid #CCCCCC; background-color:yellow; }
td.test { border: 1px solid #CCCCCC; }

does anyone know a solution ?

Please help me.

Regards to all

2
2b 1
4 5
7 8


Reply With Quote
  #2  
Old   
Lamberti Fabrizio
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 02:51 AM






The table example is this:

2
2b 1
4 5
7 8



"Lamberti Fabrizio" <lambu (AT) quipo (DOT) it._cut_off> wrote


I've got the problem described in the table above.

I've put a div red with some text inside a TD, but its height is less than 100% of TD height as you can see.

I've defined the following styles:

div.test { background-color:red; height:100%; width: 100%; }
table.test { border: 1px solid #CCCCCC; background-color:yellow; }
td.test { border: 1px solid #CCCCCC; }

does anyone know a solution ?

Please help me.

Regards to all

2
2b 1
4 5
7 8


Reply With Quote
  #3  
Old   
Roy Schestowitz
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 03:04 AM



__/ [Lamberti Fabrizio] on Monday 29 August 2005 08:51 \__


Hi Lamberti,

I have read your message twice, but I still fail to grasp what you are
trying to achieve, why, and how.

Quote:
The table example is this:

2
2b 1
4 5
7 8

What is the symbolic meaning of the digits? Could you pad it with some
hyphens ("-") and vertical pipes ("|")?


Quote:
I've got the problem described in the table above.

Have you got a URL where this can be viewed? Code and rendered HTML is
easier to appraise/criticise.


Quote:
I've put a div red with some text inside a TD, but its height is less than
100% of TD height as you can see.
It is not good practice to embed divs in table cells.

I fail to see it, but maybe somebody else can visualise it more easily than
me.


Quote:
I've defined the following styles:

div.test { background-color:red; height:100%; width: 100%; }
table.test { border: 1px solid #CCCCCC; background-color:yellow; }
td.test { border: 1px solid #CCCCCC; }

It would be helpful to see the corresponding HTML so that we can view it our
browsers.


Quote:
does anyone know a solution ?

Please help me.

Regards to all

2
2b 1
4 5
7 8

I sincerely wish to help, but I would argue that you did not provide enough
clear information. I could venture some guesses, but will not be able to
test the outcome as I lack the corresponding (X)HTML code.

Roy


Reply With Quote
  #4  
Old   
Els
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 03:04 AM



Lamberti Fabrizio wrote:

Quote:
The table example is this:
That's not a table.
Even if I open the HTML version of this post (do not send as html
again!) I don't see a table.

Upload your example somewhere on a server, and give the URL.
That way we can see what is happening.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Reply With Quote
  #5  
Old   
Lamberti Fabrizio
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 03:50 AM



sorry this is the table:

2
2b 1
4 5
7 8


Reply With Quote
  #6  
Old   
Els
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 04:11 AM



Lamberti Fabrizio wrote:

Quote:
sorry this is the table:

2
2b 1
4 5
7 8
What you are showing there, is /not/ a table, and is even less capable
of showing any height problems.

Give us a URL to a real live example.

Also:
You're not reading what I wrote.
And you're not quoting what I wrote either, that may have something to
do with that.

Please quote what it is you are replying to, do not post in HTML, and
read a post before you reply to it.

TIA.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Reply With Quote
  #7  
Old   
Els
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 04:31 AM



Roy Schestowitz wrote:

Quote:
__/ [Lamberti Fabrizio] on Monday 29 August 2005 09:50 \__

sorry this is the table:

2
2b 1
4 5
7 8

You mean /this/?

==================================
[snip code]

Quote:
==================================

In UseNet, you should never post HTML messages. It causes confusion and
results on chaos. The above is _not_ a copy extracted from the source (Els
and others, you can copy and paste the above to view). I had to clean up
about 30 invalid characters just to be able to view it as a page.
Thanks, Roy :-)

Lamberti: the reason the height of 100% isn't obeyed by IE, is that
you didn't say 100% of what. The TD hasn't a set height.
To get both IE and other browsers to obey, feed IE a 1px height to the
TD. Like so:
td.test{_height:1px;} (the underscore makes the style invisible for
anything but WinIE)

Best is though to not want a div in a table cell for colour. Just set
the colour to the table cell itself.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Reply With Quote
  #8  
Old   
Lamberti Fabrizio
 
Posts: n/a

Default Re: 100% height of a div inside a TD - 08-29-2005 , 07:05 AM



Quote:
Lamberti: the reason the height of 100% isn't obeyed by IE, is that
you didn't say 100% of what. The TD hasn't a set height.
To get both IE and other browsers to obey, feed IE a 1px height to the
TD. Like so:
td.test{_height:1px;} (the underscore makes the style invisible for
anything but WinIE)

Simple and perfect solution...thnx

Quote:
Best is though to not want a div in a table cell for colour. Just set
the colour to the table cell itself.

I know but it's necessary to use a DIV in this case


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.