2 replies [Last post]
chouchou2
Offline
newbie
Last seen: 16 years 40 weeks ago
Timezone: GMT+1
Joined: 2004-04-12
Posts: 2
Points: 0

Hi,

What I would like to do is pretty easy using tables, but I can't manage to do it right using css. Here's the 'table' code :

<table width="600" bgcolor="red"> 
 		<tr> 
			<td align='left' width="300">Some text</td> 
			<td align='right'>Some other text</td> 
		</tr> 
</table>

Notice the different alignments for the two texts. I'm new to CSS so maybe that's a dumb question, sorry about that Smile

David

Excavator
Excavator's picture
Offline
Enthusiast
Alaska
Last seen: 6 years 4 weeks ago
Alaska
Timezone: GMT-9
Joined: 2004-04-04
Posts: 121
Points: 60

Different alignment on the same row

I hope this helps:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
#header_container {
	margin: 5px;
	padding: 0px;
	left: 0px;
	top: 0px;
}
#header_left {
	background-color: #00FF00;
	float: left;
	height: 100px;
	width: 50%;
}
#header_right {
	background-color: #993300;
	float: right;
	height: 100px;
	width: 50%;
}
-->
</style>
</head>

<body>
<div id="header_container">
  <div id="header_left">Content for id "header_left" Goes Here</div>
  
  <div id="header_right">Content for id "header_right" Goes Here</div>
</div>
</body>
</html>

chouchou2
Offline
newbie
Last seen: 16 years 40 weeks ago
Timezone: GMT+1
Joined: 2004-04-12
Posts: 2
Points: 0

Different alignment on the same row

Thanks !!

Just added the line in bold :

#header_right { 
   background-color: #993300; 
   float: right;
   [b]text-align: right;[/b]
   height: 100px; 
   width: 50%; 
} 

Thanks again Excavator, you rock Smile

Edit : well, the line supposed to be bold lol