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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dual cell alignment 1

Status
Not open for further replies.

MikeT

IS-IT--Management
Feb 1, 2001
376
US
In one table cell I want to have text at the far right of the cell, but also some centered text.
Is this possible?
 
Use a nested table:

Code:
<Table>
  <TR>
    <TD>
      <Table celpadding=0 cellspacing=0>
        <TR>
          <TD width=33%>&nbsp</TD>
          <TD Align=Center width=33%>Centered</TD>
          <TD Align=Right width=33%>Right</TD>
        </TR>
      </Table>
    </TD>
  </TR>
</Table>

Basically, this will keep a blank left cell, a centered center cell, and a right-aligned right cell.

Kevin
 
...or if your text is on more than one line, you could do it more simply by doing...

<table>
<tr>
<td>
<p align=&quot;right&quot;>right</p>
<p align=&quot;center&quot;>centre</p>
</td>
</tr>
</table>

ss
 
another way:
for some browsers do not like nested tables
create another <td> and load with a clear pix
 
I would also not use a <td></td> as empty. Throw in &nbsp;

Cells should always have something in them.

Mike
 
OK, what about going back to the old trick:
if you do not expect many text change
could you do a text/photo
(treating your text as a GIF)?
 
One of the texts is the last modified date of the page, so that will not work, the other is just an email link, which a gif might do nicely for...
 
I tried using the <p align=&quot;...&quot;> method and it doesn't work (in IE5.5). Neither does <p style=&quot;text-align:right&quot;>, nor using spans, nor using divs. I think the nested table method is probably your best bet. motte is correct about not using an empty table cell too. You're better off to put something in it. He probably had & n b s p ; (without the spacing), but it got translated to a space. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
i would just use dhtml layers. in the head:

#left{
top:500; <!--or however far down the page it has to be-->
left:0; <!--that'll make it right up against the left side-->}
#right{
top:500;
left:1;<!--it will get pushed over by the other one, but you can defign this iof you want-->}

in the body:

<div di=&quot;left&quot;>
put the left stuff here
</div>
<div id=&quot;right&quot;>
put the right stuff here
</div>

that should do the trick, unless of corse i read the rpoblem wrong...i just skaned it, but you should be able to figure it out using this method. not knowing is an excuse for those umwilling to lern -- John Rueben
 
sorry, you'll need <style></style> tags around the top one. not knowing is an excuse for those umwilling to lern -- John Rueben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top