CSS to show submited data as list

Discussion in 'HTML & Website Design' started by Site Owner, Aug 2, 2007.

  1. #1
    I have a table that shows data with bullet infront of each item. But when I display it is doesn't show as a list... It shows like this:

    • AC • Water

    Is there anyway to use CSS to make it show like this?:

    • AC
    • Water

    It would simply have to put a <BR> before each •
     
    Site Owner, Aug 2, 2007 IP
  2. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe the style attribute "display: list-item" will do what you want, bullet pointing each item and putting htem on a new line...

    http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/display_list_item.html
     
    ecentricNick, Aug 2, 2007 IP
  3. Courtenay

    Courtenay Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Somewhere in your code have you set either ul or li to display: inline;? If so, remove or make it class specific.
     
    Courtenay, Aug 2, 2007 IP
  4. Site Owner

    Site Owner Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    But that is for static data. My data will be displayed from database something like: $showdata

    The data is submitted from a form. I have a feeling this can't be done with CSS so I have posted in programming.
     
    Site Owner, Aug 2, 2007 IP
  5. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You specifically asked if it could be done with CSS.

    Both of the responses you've had refer to CSS.

    It can also be done with programming. But, you can do it with CSS.
     
    ecentricNick, Aug 2, 2007 IP
  6. Site Owner

    Site Owner Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The method you gave me obviously didn't work. How is it supposed to know where to put the line break?

    Using...
    li {
    display: list-item;
    list-style-type: disc;
    }

    <li>$showlist</li>

    Just gives me:
    • • AC • Water
     
    Site Owner, Aug 2, 2007 IP
  7. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If $showlist contained...

    "<li>AC</li><li>Water</li>"

    rather than "AC • Water" it would work fine.

    How are you building $showlist?
     
    ecentricNick, Aug 2, 2007 IP