SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    About my last question: "Printing rows horizotal", everything seems to be o.k. Thanks kyank for your answer...
    Now,

    Because sometime a searched option has no value i want to automaticly generate a '&nbsp' instead. This, because i want to make a coloured tablerow in the output. And in the cells has to stand at minimum an '&nbsp' otherwise the cell will be ignored. (as you all (?) know.) The piece of script i thought would do it:
    ----------
    if (data()==""){echo " ";}
    ----------
    The error message i get:
    Fatal error: Call to undefined function: data()

    Someone can help me?
    Greets,

    Joep

  2. #2
    SitePoint Member
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    allright, the HTML is off. (i thought, but the code is still transformed to output)
    What i meant is an 'spacebar' in the cell. like an 'nbsp' (& in advance ofcourse)
    Greets,

    Joep

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I'm understanding you, then, yes, just put a nonbreaking space character in the code for your table cells ("<td> $yourvariable</td>"). At least that's what works for me.

    ------------------
    "Whatever can be said can be said clearly." -- Ludwig Wittgenstein

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    html code off. I forgot. Geeez! use the ampersand (&) in front of "nbsp;"

    I really must learn how all these bulletin boards work.

  5. #5
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Joep,

    You've got the right idea. You just need to figure out what variable normally contains the value, and echo(" ") if it contains nothing.

    if (!$data) echo " ";

    where $data is the variable that would normally contain the value.


    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!

    [This message has been edited by kyank (edited August 06, 2000).]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •