Jump to content

Make table wider


mr cracker

Recommended Posts

Hello.

 

i have this code:

$tabla="tbl_familias";   //NOMBRE DE LA TABLA A MOSTRAR

$result = mysql_query("select * from $tabla");

echo "<table bgcolor=\"#DBEDE9\" align=center  style=\"border:5px outset green\">";

for ($i = 0; $i < mysql_num_fields($result); $i++)

{

	print "<th>".mysql_field_name($result, $i)."</th>\n";

	}

	while ($registro = mysql_fetch_row($result))

	{

		echo "<tr>";

		foreach($registro  as $clave)

		{

			echo "<td bgcolor=\"white\"style=\"border:2px groove black\" align=\"center\">",$clave,"</td>";

			}

			}

echo "</tr></table>";

 

 

i get this table:

 

table2.gif

 

 

but its too small, and i want to make it bigger / wider.  I've tried using width like  this:

 

echo "<table bgcolor=\"#DBEDE9\" align=center width="600"  style=\"border:5px outset green\">";

 

but i get: Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';'

 

 

Thanks.

Link to comment
Share on other sites

To open and close the echo you're using double quotes, so if you want to use double quotes anywhere inside of the string you must escape them, so it doesn't think you want to stop the echo there.

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.