Jump to content

the use of <br /> or \n


kevdoug

Recommended Posts

Hi I am trying to display images with the image title with a table but I can't get them in line. I would like the title either above or below the image. All I get at the moment is the title to the side of the image. I have the code below.



        [color=red]echo "<tr>";
          echo "<td>";
                echo "<a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'>";
  echo "</td>";
echo "</tr>";

      I have tried [color=red]echo "<br  />";[/color] and [color=red]echo "\n";[/color] here but niether works.

echo "<tr>";
  echo "<td>";
echo OCIResult($stmt,'TITLE');
  echo "</td>";
echo "</tr>";[/color]


Link to comment
Share on other sites

Worked fine for me, but I echoed it all in one piece.

[quote]<?php


echo "<table><tr>
<td><a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'><br /><br />
</td>
</tr>
<tr>
<td>
Title
</td>
</tr></table>";

?>[/quote]

Link to comment
Share on other sites

[quote author=treilad link=topic=101273.msg400568#msg400568 date=1153414010]
Worked fine for me, but I echoed it all in one piece.

[quote]<?php


echo "<table><tr>
<td><a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'><br /><br />
</td>
</tr>
<tr>
<td>
Title
</td>
</tr></table>";

?>[/quote]


[/quote]

I am echoing the [color=red]TITLE[/color] as a colum from the table.
Link to comment
Share on other sites

[quote author=king arthur link=topic=101273.msg400563#msg400563 date=1153413806]
You haven't closed the anchor tag, e.g. with
[code]
</a>
[/code]
after the img tag.
[/quote]
thanks but closing the img tag has no effect.
Link to comment
Share on other sites

[quote author=treilad link=topic=101273.msg400585#msg400585 date=1153414953]
Yes, I know. But since I don't have that table I just used text. Have you tried mine, substituting your code in?
[/quote]

Yes your code works but when I replace the TITLE for colum TITLE retrieved from the table it goes back to the side.
Link to comment
Share on other sites

[quote author=treilad link=topic=101273.msg400585#msg400585 date=1153414953]
Yes, I know. But since I don't have that table I just used text. Have you tried mine, substituting your code in?
[/quote]

I've managed to get it to work with the title under the image thanks.
The only prolem now is that they are in a single colum down the page instead of across the page in a row.
Link to comment
Share on other sites

[quote author=HeyRay2 link=topic=101273.msg400615#msg400615 date=1153417113]
Can you link the page you are creating so we can see exactly what you are seeing?
[/quote]

The sites not live yet. Is there a way to insert a screen shot?

Link to comment
Share on other sites

[quote author=wildteen88 link=topic=101273.msg400629#msg400629 date=1153417971]
Use the img code:
[code][img]img-url-here[/img][/code] tags, if you want to place a screen shot
[/quote]

The img tag aren't working or at least I can't see the image in preview. but this is what I am getting. The code is also below.

          >:(
        angry

          :(
        sad

          :'(
          cry    This is what I get


  >:(        :(          :'(     
angry      sad        cry    This is what I would like

Any way I hope you get the idea.

[color=red] while (OCIFetch($stmt))
      {
     
    $img = OCIResult($stmt,'IMAGE');
$titl = OCIResult($stmt,'TITLE');
echo "
<table>
<tr>
<td><a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'></a>;
</td>
</tr>

<tr>
<td>
$titl
</td>
</tr>
</table>";


      }[/color]
Link to comment
Share on other sites

You still aren't closing the <a> tag - IE will take this to mean the entire rest of your table is part of the link.

Try something like

[code]

$img = OCIResult($stmt,'IMAGE');
$titl = OCIResult($stmt,'TITLE');

echo "<table><tr><td><a href=" . $img . " target='new'><img src='" . $img . "' height='75' width='100'><br />" . $titl . "</a></td>\n";
echo "<td><a href=" . $img . " target='new'><img src='" . $img . "' height='75' width='100'><br />" . $titl . "</a></td>\n";
echo "<td><a href=" . $img . " target='new'><img src='" . $img . "' height='75' width='100'><br />" . $titl . "</a></td></tr></table>\n";

[/code]
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.