How can i do this?? (easy)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Maluendaster
Forum Contributor
Posts: 124
Joined: Fri Feb 25, 2005 1:14 pm

How can i do this?? (easy)

Post by Maluendaster »

I have a script that randomize images + text in tables, and look like this...

(5 or more rows, just 1 column)

Image

But i want that the tables look like this...

(5 rows and 1 or more columns with no Text, just the image, (ill be adding colums) )
Image

I think this is the code...

Code: Select all

$links[0][link] = "<table width=\"250\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td><a href=\"http://regretless.com\" target=\"_blank\"><img src=\"regretless.gif\" border=\"0\" align=\"right\" width=\"75\" height=\"75\" style=\"filter:alpha(opacity=40)\" onMouseover=\"high(this)\" onMouseout=\"low(this)\"></a><font face=verdana size=1>regretless.com is dodo's collective domain where you can find all of her sites.</font></td></tr></table>";
	$links[0][priority] = 1;

	$links[1][link] = "<table width=\"250\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td><a href=\"http://pure-essence.net\" target=\"_blank\"><img src=\"pureessence.gif\" border=\"0\" align=\"right\" width=\"75\" height=\"75\" style=\"filter:alpha(opacity=40)\" onMouseover=\"high(this)\" onMouseout=\"low(this)\"></a><font face=verdana size=1>pure-essence.net is dodo's personal domain that shows who she is in real life and has her blog.</font></td></tr></table>";
	$links[1][priority] = 1;

	$links[2][link] = "<table width=\"250\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td><a href=\"http://board.regretless.com\" target=\"_blank\"><img src=\"dmb.gif\" border=\"0\" align=\"right\" width=\"75\" height=\"75\" style=\"filter:alpha(opacity=40)\" onMouseover=\"high(this)\" onMouseout=\"low(this)\"></a><font face=verdana size=1>dmb is dodo's popular message board. it's G rated and welcome all friendly members.</font></td></tr></table>";
	$links[2][priority] = 1;
Thank you....
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: How can i do this?? (easy)

Post by Christopher »

Move the <table> and <tr> outside your code:

Code: Select all

$links[0][link] = "<td><a href=\"http://regretless.com\" target=\"_blank\"><img src=\"regretless.gif\" border=\"0\" align=\"right\" width=\"75\" height=\"75\" style=\"filter:alpha(opacity=40)\" onMouseover=\"high(this)\" onMouseout=\"low(this)\"></a></td>";
	$links[0][priority] = 1;

	$links[1][link] = "<td><a href=\"http://pure-essence.net\" target=\"_blank\"><img src=\"pureessence.gif\" border=\"0\" align=\"right\" width=\"75\" height=\"75\" style=\"filter:alpha(opacity=40)\" onMouseover=\"high(this)\" onMouseout=\"low(this)\"></a></td>";
	$links[1][priority] = 1;

	$links[2][link] = "<td><a href=\"http://board.regretless.com\" target=\"_blank\"><img src=\"dmb.gif\" border=\"0\" align=\"right\" width=\"75\" height=\"75\" style=\"filter:alpha(opacity=40)\" onMouseover=\"high(this)\" onMouseout=\"low(this)\"></a></td>";
	$links[2][priority] = 1;
(#10850)
Maluendaster
Forum Contributor
Posts: 124
Joined: Fri Feb 25, 2005 1:14 pm

Post by Maluendaster »

Thank you! it worked good, but for some reason, the table it's aligned Right.... i put the align=center or left in the <table> tag but nothing happened. how can i fix this?
Post Reply