Link to home
Start Free TrialLog in
Avatar of RDurish
RDurishFlag for United States of America

asked on

Table Cell sizes

The outcome I am looking for is to have the content of the middle of 3 cells always be centered between the content of the outer 2 cells.

My initial thought was to just create a 1 row 3 cell table with align left, center, right respectfully.  However the auto widths aren't staying tight to the content like I would hope.

The last and middle cells text will always be the same, but the first cell will change depending on a  number of situations.

The possible text for the first cell will be:
Chat - Debate Room
1 member chatting - Join!
x,xxx members chatting - Join!


This is the current html that isn't cutting it:

<div class="postwallrightlinks">
    	<table cellspacing="0" cellpadding="0">
        	<tbody>
            	<tr>
                	<td align="left"><a title="Chat Now!" href="/Chat.htm">Chat - Debate Room</a></td>
                    <td align="center"><a title="Blog" href="/Blog.htm">Blogs</a></td>
                    <td align="right"><a title="Go to My 10 I Believe Question" href="/AdminPage_EditProfile.aspx">Go to My 10 I Believe Questions</a></td>
                </tr>
            </tbody>
        </table>
    </div>

Open in new window

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Unless you use fixed widths, table cells adjust to the content.  They're supposed to.
ASKER CERTIFIED SOLUTION
Avatar of SHOAB
SHOAB
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
your code seems fine, only need to give "width="100%" in the table.

please let me know if it doesn't work for you.

regards
deepak
Avatar of RDurish

ASKER

Not a big percentage fan. But by making all the cells the same size it worked thanks for the suggestion!