Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 05-05-2010, 07:31 PM Expanding Tables
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Hi
I have a table inside of another table:
Quote:
<table with=100% border="0">
<tr>
<td align="center">
<table with=95% border="0">
<tr>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
<td align="center"> some content</td>
</tr>
</td>
</tr>
</table>
Depending of a situation, all cells are filled with a certain value.
Using "if" statements, some of the cell’s are not shown, but sometimes all have values, making the cell’s to appear. When this happen, the total cells width, are larger than the table width, and the cell stretches horizontally throughout the monitor, getting out of the table, instead of dropping down, expanding the height of the table, and appearing vertically.
I cannot open and close, the middle cell’s with <tr>and ></tr>, due the fact, if a certain cell does not have any value, it leaves a empty space.
Can somebody give me a hint?
thanks
josil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-06-2010, 02:33 PM Re: Expanding Tables
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Can you post a LINK to the page or ALL the code?

Why are you using nested tables anyway?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-06-2010, 09:44 PM Re: Expanding Tables
Madman340's Avatar
Web Designer

Posts: 571
Name: Jared
Location: Florida
Trades: 1
Have you tried using %'s instead of concrete width/height values?
__________________

Please login or register to view this content. Registration is FREE
for cheap hosting solutions.
Use the coupon code "SINGLECENT" to pay just a single cent for the first month!
Madman340 is offline
Reply With Quote
View Public Profile
 
Old 05-07-2010, 03:32 PM Re: Expanding Tables
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Hi people

thank you very much for your help

here it is the full code that I made. Sorry it is in portuguese!!!


Quote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?
include "call_DB.inc.php";
$sql2="select * from DB_TABLE where sale='1' and id=$id limit 1";
$resultado2=mysql_db_query("DB_NAME",$sql2) ;
$registo2=mysql_fetch_array($resultado2);
$id=$registo2["id"];
$referencia=$registo2["referencia"];
$freguesia=$registo2["freguesia"];
$cidade=$registo2["cidade"];
$codigopostal=$registo2["codigopostal"];
$estado=$registo2["estado"];
$pais=$registo2["country"];
$preco=$registo2["preco"];
$moeda=$registo2["moeda"];
$arealote=$registo2["arealote"];
$areaconstrucao=$registo2["areaconstrucao"];
$ano=$registo2["ano"];
$pisos=$registo2["pisos"];
$quartos=$registo2["quartos"];
$wc=$registo2["wc"];
$onsuite=$registo2["onsuite"];
$cozinha=$registo2["cozinha"];
$despensa=$registo2["despensa"];
$lavandaria=$registo2["lavandaria"];
$escritorio=$registo2["escritorio"];
$biblioteca=$registo2["biblioteca"];
$salajantar=$registo2["salajantar"];
$salaestar=$registo2["salaestar"];
$salacomum=$registo2["salacomum"];
$arcon=$registo2["arcon"];
$aqcen=$registo2["aqcen"];
$vaccum=$registo2["vaccum"];
$lareira=$registo2["lareira"];
$jacuzzi=$registo2["jacuzzi"];
$sauna=$registo2["sauna"];
$gym=$registo2["gym"];
$spa=$registo2["spa"];
$cave=$registo2["cave"];
$parqueamento=$registo2["parqueamento"];
$garagem=$registo2["garagem"];
$arrecadacao=$registo2["arrecadacao"];
$barbeque=$registo2["barbeque"];
$piscina=$registo2["piscina"];
$jardim=$registo2["jardim"];
$tenis=$registo2["tenis"];
$maid=$registo2["maid"];
$maidwc=$registo2["maidwc"];
$vista=$registo2["vista"];
$tvcabo=$registo2["tvcabo"];
$tvsatelite=$registo2["tvsatelite"];
$telefone=$registo2["telefone"];
$alarme=$registo2["alarme"];
$electricidade=$registo2["electricidade"];
$gas=$registo2["gas"];
$agua=$registo2["agua"];
$mobilado=$registo2["mobilado"];
$electro=$registo2["electro"];
$tipologia=$registo2["tipologia"];
$tipo=$registo2["tipo"];
?>
<table width='680' border='0' cellspacing='0' cellpadding='0' align="center">
<tr>
<td align='center'><img src='images/frames/img/fundo_top.png' width='680' height='16'/></td>
</tr>
<tr>
<td height='10' align='center' valign='top' style='background:url(images/frames/img/fundo1.png) repeat-y'>

<table width="650" border="0">
<tr>
<td align="center"><span class="style20">PROPERTY DETAILS</span></td>
</tr>

</table>

<table width="630" border="1" bordercolordark="#33BA30" align="center">
<tr>
<? if ($arealote!="" and $arealote!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Plot Area</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$arealote"; ?></font></td>

<? } if ($arearustica!="" and $arearustica!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Rustic Area</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$arearustica"; ?></font></td>

<? } if ($areaconstrucao!="" and $areaconstrucao!="-") {?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Construction Area</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$areaconstrucao"; ?></font></td>

<? } if ($ano!="" and $ano!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Construction Year</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$ano"; ?></font></td>

<? } if ($pisos!="" and $pisos!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Floors</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$pisos"; ?></font></td>

<? } if ($quartos!="" and $quartos!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>BedRooms</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$quartos"; ?></font></td>

<? } if ($wc!="" and $wc!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>BathRooms</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$wc"; ?></font></td>

<? } if ($onsuite!="" and $onsuite!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>On Suite</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$onsuite"; ?></font></td>

<? } if ($cozinha!="" and $cozinha!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Kitchen</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$cozinha"; ?></font></td>

<? } if ($despensa!="" and $despensa!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Paintry</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$despensa"; ?></font></td>

<? } if ($lavandaria!="" and $lavandaria!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Laundry</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$lavandaria"; ?></font></td>

<? } if ($escritorio!="" and $escritorio!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Office Room</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$escritorio"; ?></font></td>

<? } if ($biblioteca!="" and $biblioteca!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Library</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$biblioteca"; ?></font></td>

<? } if ($salajantar!="" and $salajantar!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Dinning Room</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$salajantar"; ?></font></td>

<? } if ($salaestar!="" and $salaestar!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Living Room</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$salaestar"; ?></font></td>

<? } if ($salacomum!="" and $salacomum!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Lounge</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$salacomum"; ?></font></td>

<? } if ($arcon!="" and $arcon!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Air Conditioned</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$arcon"; ?></font></td>

<? } if ($aqcen!="" and $aqcen!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Central Heating</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$aqcen"; ?></font></td>

<? } if ($vaccum!="" and $vaccum!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Vaccum system</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$vaccum"; ?></font></td>

<? } if ($lareira!="" and $lareira!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Fire Place</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$lareira"; ?></font></td>

<? } if ($jacuzzi!="" and $jacuzzi!="-") { ?>

<td width='77' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Jacuzzi</b></font></td>
<td width='89' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$jacuzzi"; ?></font></td>


<? } if ($sauna!="" and $sauna!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Sauna</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$sauna"; ?></font></td>
</tr>

<? } ?>


<tr>

<? if ($gym!="" and $gym!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Gym</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$gym"; ?></font></td>

<? } if ($spa!="" and $spa!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Spa</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$spa"; ?></font></td>

<? } if ($cave!="" and $cave!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Basement</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$cave"; ?></font></td>

<? } if ($parqueamento!="" and $parqueamento!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Parking Place</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$parqueamento"; ?></font></td>

<? } if ($garagem!="" and $garagem!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Garage</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$garagem"; ?></font></td>

<? } if ($barbeque!="" and $barbeque!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>BBQ</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$barbeque"; ?></font></td>

<? } if ($piscina!="" and $piscina!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Pool</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$piscina"; ?></font></td>

<? } if ($jardim!="" and $jardim!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Garden</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$jardim"; ?></font></td>

<? } if ($tenis!="" and $tenis!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Tennis Court</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$tenis"; ?></font></td>

<? } if ($maid!="" and $maid!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Maid's Room</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$maid"; ?></font></td>

<? } if ($maidwc!="" and $maidwc!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Maid's WC</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$maidwc"; ?></font></td>


<? } if ($vista!="" and $vista!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Views</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$vista"; ?></font></td>

<? } if ($tvcabo!="" and $tvcabo!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Cable TV</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$tvcabo"; ?></font></td>

<? } if ($tvsatelite!="" and $tvsatelite!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Satelite TV</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$tvsatelite"; ?></font></td>

<? } if ($telefone!="" and $telefone!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Phone</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$telefone"; ?></font></td>

<? } if ($alarme!="" and $alarme!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Alarm</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$alarme"; ?></font></td>

<? } if ($electricidade!="" and $electricidade!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Electricity</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$electricidade"; ?></font></td>

<? } if ($gas!="" and $gas!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Gas</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$gas"; ?></font></td>
</tr>
<? } if ($agua!="" and $agua!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Water</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$agua"; ?></font></td>

<? } if ($mobilado!="" and $mobilado!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Furnished</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$mobilado"; ?></font></td>

<? } if ($electro!="" and $electro!="-") { ?>

<td width='100' height='22' align='right' style='margin-right: 3'><font face='verdana' color='#000000' size='1'><b>Appliances</b></font></td>
<td width='150' bgcolor='#FFFFFF' height='22' style='margin-left: 3'><font face='verdana' size='1' color='#000000'><? echo"$electro"; ?></font></td>
</tr>
<? } ?>

</table>
</td>
</tr>
<tr>
<td align='center'><img src='images/frames/img/fundo_bot.png' width='680' height='16'/></td>
</tr>
</table>
</html>

I hope that you understand!!!

thanks
josil is offline
Reply With Quote
View Public Profile
 
Old 05-07-2010, 03:37 PM Re: Expanding Tables
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Ok, so the reason you're using tables is because you're pulling from a database?

Style your tables using CSS, not all that in-line garbage. Get rid of the awful <font> tags, again use CSS for styling text.

No matter what you do, the sum total of the parts can't be wider than it's parent. I think you may do better with percentages for widths rather than fixed values as you have them now, just as MadMan suggested.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-07-2010, 05:25 PM Re: Expanding Tables
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Ok, so the reason you're using tables is because you're pulling from a database?

Style your tables using CSS, not all that in-line garbage. Get rid of the awful <font> tags, again use CSS for styling text.

No matter what you do, the sum total of the parts can't be wider than it's parent. I think you may do better with percentages for widths rather than fixed values as you have them now, just as MadMan suggested.

Good idea. Let me try

thanks
josil is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Expanding Tables
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.80651 seconds with 12 queries