Jump to content

Table alignment


ondi

Recommended Posts

Hi,

I've been fiddling around with this code all morning but can't change how the data is published.

I want the images printed side by side, rather than on top of each other the way they are now, and the text ('descr') underneath. Here's the code im using so far, and you can see what it is currently here: www.walthamforest-fc.co.uk/stats/player.php?id=3

 

Can anyone see what i need to do to my code? thanks.

 

<table width="<?= $tb2_width ?>%" cellspacing="0" cellpadding="0" border="0">
<tr bgcolor="<?php echo $inside_c ?>">
<td align="left" valign="top">
<?php
//
//Tarkastetaan löytyykö kuva
//
$image_url = "images/" . $playerdata['id'] . ".jpg";
$image_url2 = "images/" . $playerdata['id'] . ".gif";
$image_url3 = "images/" . $playerdata['id'] . "_1.jpg";
$image_url4 = "images/" . $playerdata['id'] . "_1.gif";
$image_url5 = "images/" . $playerdata['id'] . "_2.jpg";
$image_url6 = "images/" . $playerdata['id'] . "_2.gif";

//
//Tarkastetaan, jos on pitkä esittelyteksti
//
$show_all = $_REQUEST['show_all'];

if(!isset($show_all))
{
if(strlen($playerdata['descr']) > 10000)
{
	$playerdata['descr'] = substr($playerdata['descr'], 0, 10000);

	$playerdata['descr'] .= "...[<a href=\"player.php?id=$id&show_all=1\">$txt_read_more</a>]";
}
}

Link to comment
https://forums.phpfreaks.com/topic/137342-table-alignment/
Share on other sites

mate, the code you supplied doesn't even relate to the output of the images on your page. I think in essence this is really a html problem not php. after looking at the source of the url, each image has a <br /> after it so of course they will go onto a new line. but even if you remove that, the text won't go underneath because it is in a <td> of it's own in the same row as the images. so start a new row and then display the text and it will go underneath the image.

Link to comment
https://forums.phpfreaks.com/topic/137342-table-alignment/#findComment-717690
Share on other sites

Archived

This topic is now archived and is 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.