|
-
Apr 27th, 2004, 03:17 PM
#1
Thread Starter
Frenzied Member
CSS - forcing text at top of cell [resolved]
I have a table with two columns and one row.
If the text in the right hand side column is very long and the text in the left hand column is very short, then the column with little text will move that text halfway down the column.
Is there anyone to stop this? I think CSS is the way to go, but I've not managed to figure this out.
Last edited by Acidic; Apr 27th, 2004 at 03:47 PM.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 03:23 PM
#2
Are thes cells fixed with a pixel size or in %?
You could try to set the the vertical alignment to "center" in the <td> tag, even if it's not CSS, it might work.
BTW is it in all browsers or just one or two?
I had the same problem yesterday in FireFOx or was it IE, can't remember, but not both...
-
Apr 27th, 2004, 03:41 PM
#3
Set the td's valign to top.
I don't approve of designing with tables at all, btw
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 03:45 PM
#4
Thread Starter
Frenzied Member
valign did the trick. thank you both.
CB. I find tables very handy as it helps you keep all the information where you want it. I find it better than having DIVs everywhere. Why don't you like tables?
oh, note: I was havinf the problem in IE and FX, but now both work fine.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 03:55 PM
#5
Just compare some source, ok?
Code:
<!DOCTYPE html PUBLIC "-//W3C//HTML 4.01 Strict//EN"
"http://www.w3.org/TR/1999/html401/strict.dtd">
<html lang="de">
<head>
<link href="style/core.css" media="all" rel="stylesheet" charset="utf-8">
<title>Fingerprothesenregister Login</title>
</head>
<body>
<h1>Willkommen zum Fingerprothesenregister</h1>
<form action="login.php" id="loginbox" method="post">
<p>Bitte geben Sie Ihre Login-Daten an.</p>
<div class="controlassoc">
<label for="user">Benutzername</label>
<input id="user" name="user" type="text">
<br class="clearer">
</div>
<div class="controlassoc">
<label for="passw">Passwort</label>
<input id="passw" name="passw" type="password">
<br class="clearer">
</div>
<input type="submit" value="Abschicken">
</form>
</body>
</html>
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
name="doctitle" -->
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles/oegu_hpr.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="JavaScript" src="javascript/util.js"></script>
</head>
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="145"><img src="graphics/logo.gif" width="126" height="41"></td>
<td width="455" class="Header1">ÖGU - Hüftprothesen Registers</td>
</tr>
</table></td>
</tr>
<tr>
<td height="140">
<form name="login" id="login" method="post" action="login2.php">
<fieldset>
<legend>Login</legend>
<table width="600" border="0" cellspacing="0" cellpadding="0"><tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="10"> </td>
<td width="590">
<table width="400" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><td>Benutzername</td><td><input type="text" id="username" name="username" value=""></td></tr>
<tr><td><img src="graphics/leer.gif" width="1" height="1"></td><td><img src="graphics/leer.gif" width="1" height="1"></td></tr>
<tr><td>Passwort</td><td><input type="password" name="password" id="password"></td></tr>
</table>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</fieldset>
<br>
<input type="button" name="" value="< Zurück" disabled="1">
<input type="submit" name="" value="Login >">
</form>
</td>
</tr>
</table>
<script language="JavaScript" type="text/javascript">
if(document.getElementById)
document.getElementById('username').focus();
</script>
</body>
</html>
Not posted are the style sheets, but I assure you, the pages look almost the same.
What do you mean by "keeping all the information where you want it"? Does "where" relate to the layout or the source code? And what about having divs everywhere - there's usually far fewer divs than tds.
I don't like tables because you need a WYSIWYG editor to be able to work with them, because the source is many times as long and because they're outdated.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 04:01 PM
#6
I have to agree with Acidic a bit here...like for a head line over my articles I want the headline to be aligned left, and the date to be aligned on the right side. Using a two celled table, looks much better in the code then having the 4th and 5th div inside 3 other divs...
-
Apr 27th, 2004, 04:14 PM
#7
I can do it without a single unnecessary div and a single br.
Code:
<h1>Headline</h1><div class="date">Date here</div><br class="clearer">
Code:
h1 {float: left; }
div.date {float: right; }
br.clearer {clear: both; display: inline; visibility: hidden; }
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 04:18 PM
#8
Thread Starter
Frenzied Member
Originally posted by CornedBee
Does "where" relate to the layout or the source code?
yes, that's what I meant.
Originally posted by CornedBee
I don't like tables because you need a WYSIWYG editor to be able to work with them, because the source is many times as long and because they're outdated.
I used to need a WYSIWYG, but I can do it fine without one now.
I find the source is the same length. OK your post proves otherwise, but i seem to find it not too long with tables. Of course DIVs are useful. I use them a lot for when I want information at a specific point on the page, by point I meant x and y co ord).
Are they really outdated? I know you're very up to date on these things, but I find it difficult to believe that tables are becoming obsolete. I don't want to start an argument though, so how about you keep to using DIVs (I wouldn't manage to try to convert you even if I tried anyways) and I'll keep to using tables until I see why I really shouldn't be.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 04:19 PM
#9
Thread Starter
Frenzied Member
OK, looking at your CSS I see that once I'm better at that, I might move over to not using tables.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 04:22 PM
#10
Here, this might help you make the right decision 
http://www.hotdesign.com/seybold/
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 04:31 PM
#11
Originally posted by CornedBee
I can do it without a single unnecessary div and a single br.
Code:
<h1>Headline</h1><div class="date">Date here</div><br class="clearer">
Code:
h1 {float: left; }
div.date {float: right; }
br.clearer {clear: both; display: inline; visibility: hidden; }
But you are still using one div, H1 and a br, I still can't see that it's easier then just using a two cell table. But maybe you are right,
BTW is it slow to go out an in of PHP mode all the time? Have been wondering a bit about this for a while, because I am printing the table in PHP, and if it is slow it isn't a good idea to do it your way.
-
Apr 27th, 2004, 04:33 PM
#12
I doubt it's slow to switch mode. In fact, I think the switches take almost no time and the parser is a lot faster in no-php mode.
So? I use h1, div and br. You use table, tr and 2xtd. 3 tags for me, 4 for you.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 04:34 PM
#13
Thread Starter
Frenzied Member
exactly same question here. And I'll try learning more CSS so I can at least see what the code is like when not using tables.
edit: I see you just answered the question.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 04:39 PM
#14
-
Apr 27th, 2004, 04:42 PM
#15
When I've got a bad hit in the head? 
I try to stay out of discussions where I'm not right, it hurts my image
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 04:47 PM
#16
Hehe....I am not affraid about getting a hit, someone always corrects me, so no damage is ever done anyway. Only my "image", but I can only blame that I am young, and still have much to learn, but in 3-4 years when I have finished my education, then I never will be wrong. Just have to get that job at ATI first...
BTW now when I have the oppertunity, thanks for all help the last year or so. You have done a lot to help me.
-
Apr 27th, 2004, 04:49 PM
#17
Thread Starter
Frenzied Member
Yeah, I was about to thank CB too, but though he might think I'm a big softy. And I haven't quite been here long enough anyways. but here's goes anyways. Thank for all the help from me and everyone who has ever been helped by you. you really make a great addition to this forum.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 04:52 PM
#18
Thanks 
Oh, and I'm only 19...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 04:58 PM
#19
Thread Starter
Frenzied Member
Originally posted by CornedBee
Oh, and I'm only 19...
seriously?? I'm 18, now that just makes me look bad.
Have I helped you? Please Rate my posts. 
-
Apr 27th, 2004, 04:59 PM
#20
-
Apr 27th, 2004, 05:02 PM
#21
Ah, but this way you get a chance to catch up to my 7000 posts
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 27th, 2004, 05:11 PM
#22
I actually don't care about the post count. It doesn't say anything about your skills. I have seen persons here that are way more skilled then me with a lot fewer posts, and persons that are that have more or less the same post count as me in only a few months that have only asked silly questions.
I am not saying that non of my posts are silly, but I like to think that I have sometihing to teach away, at least in the game/graphics section.
-
Jul 30th, 2004, 05:23 AM
#23
Frenzied Member
Originally posted by NoteMe
But you are still using one div, H1 and a br, I still can't see that it's easier then just using a two cell table. But maybe you are right,
I like to hook up on that.
What you´re saying in that sentence is actually the big advantage of using proper html. The fact that you use a H1 for a heading is the point of this ´new-school´ html coding. It actually used to be that way since the beginning but nobody (including me a while ago) cared as long as it looked good in the browser you were designing for.
I can talk about this for hours, but Doug Bowman already wrote a great article on why this new style coding is good:
http://www.stopdesign.com/articles/throwing_tables/
Try http://www.alistapart.com for more information.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|