Jump to content

have 2 divs extend together?


Northern Flame

Recommended Posts

How can i have 2 divs extend together?

lets say i have these 2 divs in the center of my

page:

 

<div id="left">
<h2>Left Side</h2>
<p>This is the left side of the layout.</p>
</div>
<div id="content">
<h2>Main Content</h2>
<p>This is where the main content goes....</p>
<h2>Another Paragraph</h2>
<p>This is another paragraph....</p>
<h2>Etc.</h2>
<p>.....</p>
</div>

 

 

all the content for both the left and center is different on each

page so i dont know how long it can be. i want them to both

have the same height. i've had them both extend together with

tables like this:

 

<table>
<tr>
	<td>
		<h2>Left Side</h2>
		<p>This is the left side of the layout.</p>
	</td>
	<td>
		<h2>Main Content</h2>
		<p>This is where the main content goes....</p>
		<h2>Another Paragraph</h2>
		<p>This is another paragraph....</p>
		<h2>Etc.</h2>
		<p>.....</p>
	</td>
</tr>
</table>

 

and that works fine, but i want to do this with divs. does anyone know

how i can do this with divs and css?

 

P.S. the divs each have borders so it will be obvious to the user if they do not

have the same height.

Link to comment
Share on other sites

Sure there is. Its a semantic mis-use of tables. Tables are supposed to hold tabular data, this data isn't tabular.

 

Not that it wont work. But I could wash myself with bleach everyday and become clean, that doesn't mean its the right way to use bleach.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.