html question

i’ve asked it at html forum and got no answer

i need text in a cell of a table to have had align left
so it is by default
but the last string (signature) i’d like to have aligned to the right
help please

i don’t want to use additional tables or divs

(assuming that understand correctly, and that you mean the alignment of the text within the table cell, and not the cell itself)

<html>
	<body>
		<table border="1">
			<tr>
				<td style="width: 100px;">left</td>
				<td style="width: 100px;">left</td>
				<td style="width: 100px; text-align: right;">right</td>
			</tr>
		</table>
	</body>
</html>

i need in the same cell text with 2 different alignments:
in the beginning left
in the bottom right

this way:

---------------------------------
|slajf ljlsjdf las              |
|sljfals djfl askd              |
|                      sfasdfsdf|
---------------------------------

You could have a table within the table, which you don’t want to do. Actually, it doesn’t have to be a table: it could just be another block tag, such as p.

<table>
<tr>
<td><p align="left">slajf ljlsjdf las</p>

<tr>
<td><p align="left">sljfals djfl askd</p>

<tr>
<td><p align="right">sfasdfsdf</p>
</table>

I think that should work, but I haven’t tested it.

<table cellspacing="0" cellpadding="2" class="box" width="300"> 
 <tr bgcolor="#ffffff"><td>Test msg. bla bla bla.
  <br align="right"><a href="index.jsp?user=M77">M77</a> <font class="small_font">x sec ago</font> <a href="index.jsp?reply=1">reply</a></br>
  </td></tr> 
</table>

doesn’t work
see result here

I recommend using http://www.w3schools.com/ to find HTML solutions. It’s a very informative site, and it lets you try the code. This code should get you what you want.


<table>
  <tr>
<td>
text

<span style="width: 100px; text-align: right;">text</span>
</td>
  </tr>
</table>

doesn’t work again
see result here

you could probably use css with classes and

but why don’t you want to use

?

To get your code working replace the span with a div and change the width to 100%… m77 x sec text right justified.
If you dont want to use divs, then the code Mr Gol posted works fine too… (with some minor tweaking… ie. by creating 3 table rows and placing the s in each).

Why the 100s of 's?

Why not use

tags and just draw the border?

cause i want it that way

  • space

thank u Sinuath!
i’ve got throw with a help of u

Entirely disagree, it’s one of the worst resources available for help. Many of it’s examples use bad styles or simply incorrect, whilst most of it’s information is brief, missing or just plain wrong. The lack of information is my main issue with the site, whilst W3Fools has lots more examples.

Personally I’d recommend Mozilla instead, but I mainly use that for reference rather then learning. There are plenty of excellent alternatives out there.

I don’t think you’re supposed to use the br tag that. br is for a line break. You don’t put stuff inside it and should never have any reason to use /br.

I could be wrong here, but I can’t see any way that would do anything.

Edit: Looking back on this topic, I see that my original post wouldn’t have solved your problem anyways.