Cell Problem

User 1984189 Photo


Registered User
7 posts

I have a table with 3 cells. One over two. The text in the bottom left cell is 400 words, the text in the bottom right cell is 200 words. The cell on the bottom right centers (top to bottom NOT left to right) itself on the 400 word content to its left.
So it looks like this.
xxxxxxxxx

xxxx
xxxx xxxx
xxxx xxxx
xxxx

I want it to look like this.

xxxxxxxxx

xxxx xxxx
xxxx xxxx
xxxx
xxxx

I hope that is understandable.
User 355448 Photo


Ambassador
3,144 posts

Jesse,

Either post a link to the table, or post the code so we can see what you are trying to accomplish.

As a wild guess, I suggest you try the vertical-align style setting to top.
User 1984189 Photo


Registered User
7 posts

<table border="0" cellpadding="1" cellspacing="5" width="200">
<tr>
<td colspan="2"><font face="Arabic Typsetting" font size="-1">Content</td>
</tr>
<tr>
<td><font face="Arabic Typsetting" font size="-1">Content content content content content content content content content content content content content </td><td><font face="Arabic Typsetting" font size="-1">Content</td>
</table>


The bottom right cell containing "Content" centers itself on the mass of the bottom left cell. I want each cell to start at the top left regardless of the amount of text it contains.
User 3004957 Photo


Registered User
848 posts

One easy way to do this is with styles.

Copy and paste this code and have a play with it.

<table border="0" cellpadding="1" cellspacing="5" width="200">
<tr>
<td colspan="2" style="vertical-align: top; text-align: left">Content</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: left">Content content content content content content content content content content content content content</td>
<td style="vertical-align: top; text-align: left">Content</td>
</tr>
</table>


Note that I've removed the font tags etc; this is old style (even proprietary) coding. You can use the style statement to set your fonts as well, something like:

style="vertical-align: top; text-align: left; font-family:'Arabic Typesetting'; font-size: -1px; font-style: normal; font-weight: normal;"


There are several ways of including font elements in styles but I have chosen the long-hand version for this demonstration. Just change whatever element you want to alter the fonts.

Horizontal alignment within the cell is controlled by the text-align style and I have set it to 'Left' but you can choose whatever you want (centre, right, justify).

If you don't want this style for any given cell, don't include it in that cell's 'td' tag.

I hope this is what you were after.

Dave.
User 1984189 Photo


Registered User
7 posts

Thank you both very much! Big help!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.