Jump to content

Line breaks on mysql generated text


cactus

Recommended Posts

Hi

 

My problem is that text that is in my database are showing up next to each other in a line rather than on seperate lines, normally I would have just used <br> but as it's generated from my sql I don't know how to do it.

 

<ul id="headlines">

<?php foreach ( $results['articles'] as $article ) { ?>

		<a href=".?action=viewArticle&articleId=<?php echo $article->id?>"><?php echo htmlspecialchars( $article->title )?></a>

<?php } ?>

      </ul>

 

Anyone have any idea? Thanks :)

Link to comment
Share on other sites

try wrapping li tags around the anchors

<ul id="headlines">

<?php foreach ( $results['articles'] as $article ) { ?>

		<li><a href=".?action=viewArticle&articleId=<?php echo $article->id?>"><?php echo htmlspecialchars( $article->title )?></a></li>

<?php } ?>

      </ul>

Link to comment
Share on other sites

Thank you that got rid of the bullet points is there anyway to make a bigger gap between the points like you would normally do with a <br> sign?

 

There a bit too squished together for what I want. Thanks for the help :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.