Jump to content

How to display objects in a row


LexHammer

Recommended Posts

I have 7 codes that i want to display in a row one next to another.

The first is {$ads->ads_display('1')}, the second {$ads->ads_display('2')} and so on...

They appear one under the other. I want them to appear like this: @ @ @ @ @ @

 

Can you pls give me the code that i need for that...

Link to comment
Share on other sites

I assume you mean for SMARTY? Then you pretty much have the code..

 

{$ads->ads_display('1')} {$ads->ads_display('2')} {$ads->ads_display('3')} {$ads->ads_display('4')} {$ads->ads_display('5')} {$ads->ads_display('6')} {$ads->ads_display('7')}

Link to comment
Share on other sites

Well by default DIVs are block elements that will appear on a new line. Look at your code..

 

<div>
<div Xstyle='float:left'>
<a href='http://www.****.com/***/'>
<img src=http://www.****.com/./uploads_user/1000/2/0_4230.jpg width=50 border=0>
</a>
</div>
<div></div>
</div>

 

They're each obviously going to appear on a new line. I think you were on the right track before with the "float:left"; though I'm not sure why there's an "X" before the style attribute? Because there's a parent DIV to the floated DIV though, you're still going to end up with each block on a new line. Float the most parent DIV of each block of code basically.

 

<div style="float: left;">
    <a href='http://www.****.com/***/'>
        <img src=http://www.****.com/./uploads_user/1000/2/0_4230.jpg width=50 border=0>
    </a>
</div>

 

Give that a try, stripped out some of the useless code. You'll probably need to use "clear: both" after.

 

Just to add though, is there any need for them to be wrapped within a div?

Link to comment
Share on other sites

I used your code, but no change at all, they are still in a column Just to tell you, that i have very low php skills so dont ask me to do anything:) I just can copy paste the code you give me and adjust it with my content...

What about if the ads_display codes are inserted itno in a table?

Link to comment
Share on other sites

Heh noo, don't use tables. As I said before is there any special reason why these images need to be wrapped in a div? Styling purposes or anything? If not just remove it so you just have the image:

 

<a href='http://www.****.com/***/'>
    <img src=http://www.****.com/./uploads_user/1000/2/0_4230.jpg width=50 border=0>
</a>

Link to comment
Share on other sites

I dont know what else to show you... this is all i got.  The div was because of an option that can have text comment for the ad, but no need of that.

 

Here is the row code without the div.

 

<a href='[userprofile]'>

<img src=[userphoto] width=[userphotowidth] border=0>

</a>

 

That will display the user's photo on the top of the page and when somebody click on it, he will be redirected to the profile.

 

I think that making the pictures in a table with 10 pictures/row will be good if there is no other way now...

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.