| | |
Vertically Expanding a DIV inside a Table TD
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I looked around for a solution on the site but I couldn't find exactly what I was looking for so...
On my website I have a Table with 2 columns, each column has a DIV in it. How can I make it so that each of the DIVs take up the entire space in the Table TD? I can post an example or link to the site itself...if thats allowed.
On my website I have a Table with 2 columns, each column has a DIV in it. How can I make it so that each of the DIVs take up the entire space in the Table TD? I can post an example or link to the site itself...if thats allowed.
~UzuNarU~ - Endless Possibilities
0
#2 Nov 4th, 2009
Why using DIV's in a table ?
You can get the same result by floating the two divs with CSS.
html :
If you persist in keeping the divs in a table column I don't see the problem because the row of the table will automatically expand to the content of the largest div.
An example of your code would the interesting to see what you want to achieve.
You can get the same result by floating the two divs with CSS.
html :
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <style> #divone { width: 50%; float: left; } #divtwo { width: 50%; float: left; } </style> </head> <body> <div id='divone'>bla bla bla</div> <div id='divtwo'>bla bla bla</div> </body> </div>
If you persist in keeping the divs in a table column I don't see the problem because the row of the table will automatically expand to the content of the largest div.
An example of your code would the interesting to see what you want to achieve.
Last edited by soldierflup; Nov 4th, 2009 at 6:02 am.
0
#3 Nov 4th, 2009
Umm, you can take a look at the site: http://www.uzunaru.com
If I float the DIVs does that mean they will appear side by side? Sorry, I'm not really very good at doing more fancy web templates/layouts. Usually I just do plain sites but wanted to try something different.
If I float the DIVs does that mean they will appear side by side? Sorry, I'm not really very good at doing more fancy web templates/layouts. Usually I just do plain sites but wanted to try something different.
~UzuNarU~ - Endless Possibilities
0
#4 Nov 4th, 2009
If you float the divs the will appear side by side. I've been looking at your code and I suppose you want to make appear the right div at the top of the column in your table. Change your code from the right column of your table to :
This will put the div inside your column at the top of the column.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<td width="251px" valign="top">
This will put the div inside your column at the top of the column.
Last edited by soldierflup; Nov 4th, 2009 at 9:36 am.
0
#5 Nov 4th, 2009
•
•
•
•
If you float the divs the will appear side by side. I've been looking at your code and I suppose you want to make appear the right div at the top of the column in your table. Change your code from the right column of your table to :
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<td width="251px" valign="top">
This will put the div inside your column at the top of the column.
Hmm ok, that solves one problem. Now the problem of the Nav column not expanding to the whole available area in the right column is the second. If I have to I will check out this "float". Quick Q~ about floating DIVs do that need a containing DIV?
~UzuNarU~ - Endless Possibilities
0
#6 Nov 4th, 2009
The div's don't need a containing div because they are already in a containing div (container).
To make sure that the next div (footer) will appear correctly is adding the next statement under the second floated div : <br style="clear: both;" />
If you want to, I'll send you a redesigned example of your page.
To make sure that the next div (footer) will appear correctly is adding the next statement under the second floated div : <br style="clear: both;" />
If you want to, I'll send you a redesigned example of your page.
0
#7 Nov 4th, 2009
•
•
•
•
The div's don't need a containing div because they are already in a containing div (container).
To make sure that the next div (footer) will appear correctly is adding the next statement under the second floated div : <br style="clear: both;" />
If you want to, I'll send you a redesigned example of your page.
Also my footer is outside my container because for some reason it was getting blended into the News/Navigation DIVs.
~UzuNarU~ - Endless Possibilities
![]() |
Similar Threads
- Form Inside Table Getting Messed Up (HTML and CSS)
- Div equivalent for table stucture (HTML and CSS)
- Div Min-Height (HTML and CSS)
- float takes div out of container, need help (HTML and CSS)
- A reason to use tables instead of divs (HTML and CSS)
- dispalying msg on div with mouseover on table (HTML and CSS)
- PAGING inside a TABLE (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: IE Error (as per the norm): Object Expected
- Next Thread: change link border
Views: 476 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxcode ajaxhelp animate array automatically autoplay beta boarder box bug button calendar captcha card cart codes column cookies createrange() css cursor date debugger decimal design developer dom download dropdown element enter error events firefox firehose flash focus form frameworks getselection google gwt html htmlform iframe image() index java javascript javascripts jawascriptruntimeerror jquery jsp listbox maps marquee masterpage menu microsoft mimic mp3 mp4 offline onmouseover parameters php player post problem programming progressbar prototype rating redirect regex safari scale scriptlets search select size sources sql starrating text textarea toggle twitter validation variables w3c web website window windowofwords windowsxp xml xspf





