473,788 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Separate text alignment within list item (<li>)

Problem:
A list contained in a div contains several items that are made of two
parts: itemName and itemValue.

ie:

<div id="data">
<li>longtime1 <span> 1326 mins></span></li>
<li>longtime2 <span> 1692 mins</span></li>
<li> time1 <span> 24 mins </span></li>
<li> time2 <span> 1 min </span></li>
<li> time3 <span> 4 mins </span></li>
<li> time4 <span> 0 mins </span></li>
<div>

Is it possible (using css) to right align the itemValues while at the
same time left align the itemNames? I was unsuccessful with the below
CSS. Of course there is the alternative of using an html table but I
wanted to see the CSS alternative (if one exists).

#data ul {
list-style-type: none;
margin: 0px 0px 0px 0px;
}
#data ul li {
font-size: .75 em;
text-align: left;
}
#data ul li span {
margin-right: 0px;
}

Thanks for any input:
Abro
Jul 20 '05 #1
3 10773

"abro" <bs*******@hotm ail.com> wrote in message
news:23******** *************** ***@posting.goo gle.com...
Problem:
A list contained in a div contains several items that are made of two
parts: itemName and itemValue.

ie:

<div id="data">
<li>longtime1 <span> 1326 mins></span></li>
<li>longtime2 <span> 1692 mins</span></li>
<li> time1 <span> 24 mins </span></li>
<li> time2 <span> 1 min </span></li>
<li> time3 <span> 4 mins </span></li>
<li> time4 <span> 0 mins </span></li>
<div>

Is it possible (using css) to right align the itemValues while at the
same time left align the itemNames? I was unsuccessful with the below
CSS. Of course there is the alternative of using an html table but I
wanted to see the CSS alternative (if one exists).


This *is* a table, so there's no need for pretending it's a list or using a
CSS alternative.

Besides--you *do* know that <li> doesn't go inside <div>?

Jul 20 '05 #2
On Wed, 29 Sep 2004 16:55:11 -0400, Harlan Messinger
<h.*********@co mcast.net> wrote:
Besides--you *do* know that <li> doesn't go inside <div>?


Sure it can - supposing there's an intervening ul or ol.
Jul 20 '05 #3
"Harlan Messinger" <h.*********@co mcast.net> wrote in message news:<2s******* ******@uni-berlin.de>...
"abro" <bs*******@hotm ail.com> wrote in message
news:23******** *************** ***@posting.goo gle.com...
Problem:
A list contained in a div contains several items that are made of two
parts: itemName and itemValue.

ie:

<div id="data">
<li>longtime1 <span> 1326 mins></span></li>
<li>longtime2 <span> 1692 mins</span></li>
<li> time1 <span> 24 mins </span></li>
<li> time2 <span> 1 min </span></li>
<li> time3 <span> 4 mins </span></li>
<li> time4 <span> 0 mins </span></li>
<div>

Is it possible (using css) to right align the itemValues while at the
same time left align the itemNames? I was unsuccessful with the below
CSS. Of course there is the alternative of using an html table but I
wanted to see the CSS alternative (if one exists).
This *is* a table, so there's no need for pretending it's a list or using a
CSS alternative.


Thank you Harlan for your comments.
You didn't entirely address my 'Is it possible' question? Which are
you saying:

A) No it is not possible. Use a table.
B) Yes it is possible, but 'incorrect'. Use a table.

If the answer is B.. is there anyone out there that is willing to tell
me how to do it without a table?

Besides--you *do* know that <li> doesn't go inside <div>?


I assume you are pointing out that I forgot to properly close the div
tag above </div> as well as include <ul></ul>. Both are a typo in the
posting (not my actual code :)). I appreciate the clarification. One
other aside, I removed other non-list elements from the div for my
post since they didn't relate to the question at hand. Those other
non-posted elements justify wrapping the list in a div as all of the
elements (including the list) are presentation related.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4178
by: Kelvin | last post by:
Basically, my texts consists of normal text stream and some quotations. This is my text stream, and inside "this streams" there are some "quotation pairs" which are to be replaced like this: <LI>this streams</LI> for formatting in HTML. Tried ___s/\".*?\"/<li>.*?<\/li>/g;___ but not working. Thanks.
8
6891
by: Michael | last post by:
This is a two-part question to which I haven't been able to find an answer anywhere else. 1. Is it possible to format the bullet/number character of the <li>? In my styles sheet, I have the <li> tag formatted, for example, bold. However, when it's applied, the number of the <li> is not bold, but the text is. Do I have to apply the bold to the <ol> instead? 2. When I use <li>example text</li>, and when I insert a <br> after the </li>,...
1
3757
by: Randall Sell | last post by:
OK, I am utterly stumped. The code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> ul { background-color: red; }
4
2210
by: abs | last post by:
Anybody has an idea how to get the <ul> element which is not nested in <li> element ? In other words I have several lists like this: <ul id="1"> <li>Aaaaaaaa</li> <li>Bbbbbbbb</li> <li>Cccccccc <ul> <li>111111</li> <li>222222</li>
6
2280
by: cbartlett | last post by:
If I have: <ul id="theUL"> <li id="anLi1">some text</li> <li id="anLi2">some other text</li> <ul> How can I get the value of the text within the the li's? Any help much appreciated. thanks Charlie.
7
1872
by: gener672 | last post by:
Problem: font-size seems to be rendered differently for <li class="issue"> and for <p class="issue">. (Example is in: www.dvmvac.com/snippet/ ... ignore background - I just did a quick file copy and didn't get bkgnd file resolved.) In external CSS, I define 'body' to have a font-size of 10px .... and 'h2' to be 300%(which works - see header) .... then I define (or redefine) 'p' to be 120%. Inline (testing there before exporting to css...
10
6256
by: BobaBird | last post by:
When <liis set to {max-width:45em;}, the bullets move from the top to the bottom of the <li>. Also, the bullet for a top-level <liends up on the same line as the last <liof its nested list, with both disc and circle bullets on that line. The problem is in IE7. The page displays as expected in FF 2.0.0.9. Is there a way to make IE7 behave? See http://ekb.dbstalk.com/sandbox/bulletalign.htm --
2
7068
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so the entire block is clickable, not just the text. I've sorta got it so it's clickable, just some parts of the button I still can't click on. The website is http://pdhtdev.johnabbott.qc.ca/students/2010/james_mann/portfolio/index.htm The css...
6
4473
by: capricious | last post by:
Is it possible, so that when you do multiple <UL>'s to control how deep the UL's are marked? For example, it would defaultly look like this with multiple ULs and LIs: -- Code : Main Menu<ul>Fruits<ul><li>Apples</li><li>Oranges</li></ul></ul> .. -- Returns :
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.