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

table cell formating question

Status
Not open for further replies.

dakota81

Technical User
May 15, 2001
1,691
0
0
US
I'm not sure how to accomplish this, I've got a page generated by script, so it's not fixed text. I have a table cell that's 700 pixels wide. I want to have some text that is centered within that cell. I also want another bit of text to be right-justified on the same line. I cannot use absolute positioning for other reasons.
 

I'm assuming that you mean "in the same cell" rather than "on the same line", hence:

<table border="1">
<tr>
<td width="200px" align="center">
some centred text<p align="right">Right aligned</p>
</td>
</tr>
</table>

If you actually want something "on the same line" then have a nested table with 3 cells, the middle one centred, the right one right aligned.
 
I'm guessing this is what they want:
[tt]
+---------------------------------------------------------+
| centered right-aligned |
+---------------------------------------------------------+
[/tt]

A nested table might well be the only easy way to do it.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
If you actually want something "on the same line" then have a nested table with 3 cells, the middle one centred, the right one right aligned.

Yeah, this is what I want, and that will do it, that solution just didn't form in my mind. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top