Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  html question  (Read 1492 times)
0 Members and 1 Guest are viewing this topic.
Offline m77

« In padded room »

« Posted 2011-07-14 15:14:28 »

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
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #1 - Posted 2011-07-14 15:36:55 »

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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
<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>
Offline m77

« In padded room »

« Reply #2 - Posted 2011-07-14 15:44:46 »

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

this way:
1  
2  
3  
4  
5  
---------------------------------
|slajf ljlsjdf las              |
|sljfals djfl askd              |
|                      sfasdfsdf|
---------------------------------
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline fletchergames

Senior Member





« Reply #3 - Posted 2011-07-14 17:14:22 »

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.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
<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.
Offline m77

« In padded room »

« Reply #4 - Posted 2011-07-14 17:51:13 »

1  
2  
3  
4  
5  
<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
Offline aazimon
« Reply #5 - Posted 2011-07-14 18:41:41 »

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.

1  
2  
3  
4  
5  
6  
7  
8  
<table>
  <tr>
<td>
text<br>
<span style="width: 100px; text-align: right;">text</span>
</td>
  </tr>
</table>
Offline m77

« In padded room »

« Reply #6 - Posted 2011-07-14 18:51:13 »

doesn't work again
see result here
Offline Sinuath

Junior Member


Medals: 2



« Reply #7 - Posted 2011-07-14 19:05:45 »

you could probably use css with classes and <p>

but why don't you want to use <div>?

Hey [you][/you], you should totally check out my boring Site ~ http://davediel.com/chris
Offline steveyO
« Reply #8 - Posted 2011-07-14 19:18:12 »

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 <td>s in each).

Why the 100s of <td></td>'s?

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Offline Z-Man
« Reply #9 - Posted 2011-07-14 19:22:38 »

Why not use <p></p> tags and just draw the border?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline m77

« In padded room »

« Reply #10 - Posted 2011-07-14 19:33:52 »

cause i want it that way
+ space
Offline m77

« In padded room »

« Reply #11 - Posted 2011-07-14 19:36:20 »

thank u Sinuath!
i've got throw with a help of u
Offline JL235

JGO Coder


Medals: 10



« Reply #12 - Posted 2011-07-15 01:27:18 »

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.
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.

Offline fletchergames

Senior Member





« Reply #13 - Posted 2011-07-23 19:39:07 »

1  
2  
3  
4  
5  
<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 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.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (103 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!