Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Align text in adjacent columns

Status
Not open for further replies.

dbeez

Technical User
Aug 15, 2005
71
KR
So, I'm writing a html sheet for a web page and one column has just one word - which I have positioned as
CODE
style="vertical-align:top;"

the adjacent column in the same table has a lot of text and a header.

I'd like to align the horizontally align the header in col2 with the word in col1

can anyone help me ??
 
----------------SORRY --------------------------
I cut and pasted the above question and it came out all wrong
so here goes again


So, I'm writing a html sheet for a web page. There is a table with two adjacent columns. One col has just one word which I've positioned at the top of the col like this
CODE
style="vertical-align:top;"
[/CODE]
The adjacent col has a few lines of text and a title.

I'd like to horizontally align the word in col1 with the header in col2. I'd prefer not to do this manually with padding if possible because of browser issues.

Isn't there some html/css method to do this simple task reliably ?

Thanks
 
Can you not position the text in the second column also on the top? I don't think I fully understand what you're trying to do.
 
Hi vragabond

I guess it goes something like this


|``````````|```````````|
| TITLE | |
| | text1 |
| | text2 |
| | text3 |

so I guess

<tr>
<td style="vertical-align:top;">TITLE</td>
<td>text
text
text</td>

It vertically aligns it to the top, but it's off a bit.
I'm wondering do I just have to pad TITLE to get it horizontally aligned with text1.

Is there anything in html that will just horizontally align two adjacent cols ???
 
Vragabond said:
Can you not position the text in the second column also on the top?

You seem to know how to do this. You do it for the first column. Copy/paste the style attribute into the TD tag of the second column.

--Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Like LFI said, why not do this?
Code:
 <tr>
  <td style="vertical-align: top;">TITLE</td>
  <td style="vertical-align: top;">
   text
   text
   text
  </td>   
 </tr>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top