Solved

getting three columns to have exactly the same height

Posted on 2000-05-14
5
144 Views
Last Modified: 2010-04-09
Hi.

I have three cells (columns) within a table. The columns are in the same row.

The problem I'm having is that I want all three columns to have the exact same height even though the columns have differing amount of content.

What's happening is that when I put more content in cell #3 it expands, and then it is difficult to have the other columns match exactly the height of column #3 because they have less content.

What do I have to do to make all the contents format so that they all have exactly the same height and therefore have their top and bottom borders line up exactly?

Michael
0
Comment
Question by:morya
5 Comments
 

Expert Comment

by:firelights
ID: 2809657
would u show me your code?

is it what u want: here it is

=============================
<html>
<head>
      <title>Untitled</title>
</head>

<body>


<table border=0 cellpadding=0 cellspacing=0 width=450>
<tr><td align=left valign=top width=150><table border=0 cellpadding=0 cellspacing=0>
<tr><td align=left valign=top>content 1 content 1 content 1 content 1 content 1 content 1 content 1 content 1 content 1 content 1 </td>
</tr></table></td>

<td align=left valign=top width=150><table border=0 cellpadding=0 cellspacing=0>
<tr><td align=left valign=top>content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 </td>
</tr></table></td>

<td align=left valign=top width=150><table border=0 cellpadding=0 cellspacing=0>
<tr><td align=left valign=top>content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2
content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2
content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 </td>
</tr></table></td>


</tr></table>


</body>
</html>


======================================

firelights
0
 
LVL 7

Expert Comment

by:nettrom
ID: 2810167
If you have 3 cells in the same row, the whole row will have the same height as the largest cell in the row.  So I'm not sure I understand what you're trying to do here.  Could you try to explain a bit more?

As firelights also asks, a URL would be nice.
0
 

Expert Comment

by:maritimegirl
ID: 2811370
<table>
<tr>
<td>blah</td><td>blah</td><td>blah</td>
</tr>
</table>

So that's your format?  Just modify your 3 <td> tags to be <td height=20> or whatever size you need - they will stay the same height regardless of content.
0
 

Author Comment

by:morya
ID: 2812081
I've got nested tables.  I'll put the code in here later tonight.  I have put a height in each of the td's but it hasn't helped,yet.
0
 

Accepted Solution

by:
firelights earned 75 total points
ID: 2813117
I see your question once again. I try to get your meaning. if u just want three cell top border & bottom border line up in 1 table.

try this: it works in ie5 & netscape 4.73, sorry, i don't have ie4 & netcape 4.5x or above, don't know it work on that or not.
=======================================

<html>
<head>
      <title>Untitled</title>

<script language=javascript>
<!--
h=700
//-->
</script>

</head>



<body>


<table border=0 cellpadding=0 cellspacing=0 width=450>
<tr><td align=left valign=top width=150><table border=1 cellpadding=0 cellspacing=0 width=150 height=100%>
<script language=javascript>
<!--
document.write("<tr><td align=left valign=top height="); + document.write(h); + document.write(">")
//-->
</script>
content 1 content 1 content 1 content 1 content 1 content 1 content 1 content 1 content 1 content 1 </td>
</tr></table></td>

<td align=left valign=top width=150 height=100%><table border=1 cellpadding=0 cellspacing=0 width=150 height=100%>
<script language=javascript>
<!--
document.write("<tr><td align=left valign=top height="); + document.write(h); + document.write(">")
//-->
</script>
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3
content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 content 3 </td>
</tr></table></td>

<td align=left valign=top width=150><table border=1 cellpadding=0 cellspacing=0 width=150 height=100%>
<script language=javascript>
<!--
document.write("<tr><td align=left valign=top height="); + document.write(h); + document.write(">")
//-->
</script>
content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2
content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2
content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 content 2 </td>
</tr></table></td>
</tr></table>


</body>
</html>

=======================================
it works on any height of your contents, but u need to manually edit the javascript code u see inside the <head>
<script language=javascript>
<!--
h=700
//-->
</script>
</head>

just edit the h=xxx for your requirement

=======================================

firelights

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML and CSS for a complex page 20 57
Element alignment and word wrapping 9 60
addressing a specific html page 9 43
Create html table using xsl 8 28
Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now