Solved

Problem with alignment in HTML

Posted on 2007-11-13
8
208 Views
Last Modified: 2012-06-27
I want to align the letter like the below example in html. How do I do it?? I not getting it right.

     (a)  dasdas
   (ab)  sadsad
  (abc) sadsad           < ------------   //This is what I want, align the bullet to the right.
(abcd) sad
//////////////////////////////////////////////////////////////////////////////////////////////
(a)       dasdas
(ab)     sadsad
(abc)   sadsad           < ------------   //This is what I do not want, I do not want like this ! ! !
(abcd) sad

   
0
Comment
Question by:xiaoxin85
8 Comments
 
LVL 3

Expert Comment

by:samalraj
ID: 20278112
Hi,
     you could use like
<table border=0>
<tr>
 <td align="right">(a)</td><td>  dasdas</td>
</tr>
<tr>
 <td align="right">(ab)</td><td>  dasdas</td>
</tr>

<tr>
 <td  align="right">(abc)</td><td>  dasdas</td>
</tr>

<tr>
 <td  align="right">(abcd)</td><td>  dasdas</td>
</tr>
</table>

0
 

Author Comment

by:xiaoxin85
ID: 20278115
is there any way except for table??? I do not want to use a table, is there other right??? like in css???
0
 
LVL 3

Expert Comment

by:samalraj
ID: 20278163
Hi,
     you could do it like this
<ol type="I">
 <li>Apples</li>
 <li>Bananas</li>
 <li>Lemons</li>
 <li>Oranges</li>
 <li>Apples</li>
 <li>Bananas</li>
 <li>Lemons</li>
 <li>Oranges</li>
</ol>

type can be
type="I"
type="i"
type="1"
type="a"
type="A"
 



0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 16

Accepted Solution

by:
kiranvj earned 250 total points
ID: 20278195
or like this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style>
.align_right {
      text-align:right;
      width:100px;
      float:left;
}
.align_left {
      text-align:left;
      width:100px;
      float:left;
}
</style>
</head>

<body>
<div class="align_right">(a)</div><div class="align_left"> dasdas</div><br />
<div class="align_right">(ab)</div><div class="align_left"> ddfasdas</div><br />
<div class="align_right">(abc)</div><div class="align_left"> sddas</div><br />
<div class="align_right">(abcd)</div><div class="align_left"> ada</div><br />
</body>
</html>
0
 
LVL 18

Assisted Solution

by:Eternal_Student
Eternal_Student earned 250 total points
ID: 20279028
This is even better ;-)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
dt{float:left;}
dt span{width:40px; display:block; text-align:right}
dd{padding-left:4px;}
</style>
</head>

<body>
      <dl>
            <dt><span>(a)</span></dt>
            <dd>Black hot drink</dd>
            <dt><span>(ab)</span></dt>
            <dd>White cold drink</dd>
            <dt><span>(abc)</span></dt>
            <dd>White cold drink</dd>            
      </dl>
</body>
</html>
0
 

Author Comment

by:xiaoxin85
ID: 20287246
it is gd but mi need something like if it have more than 1 line, like the 1 below.

     (a)  dasdasdsadsdasdasdasdasd
            dsadasdsadasd
   (ab)  sadsad
  (abc) sadsad          
(abcd) sad
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20558535
Forced accept.

Computer101
EE Admin
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now