Need help with this html table.

Discussion in 'HTML & Website Design' started by x0x, Apr 2, 2009.

  1. #1
    Some php in there too that creates a loop and makes a new row for every option...

    Here is how it looks at the moment:
    [​IMG]

    I left the last column without a background with intention.
    The problem is that there is no last column :D Can someone add it there?

    (the info colum) I want to add a big picture there. (I will add some java there later that will put a picture of each city that will show up when you drag your mouse on a city name). Right now I just need the problem with the column solved, I'm really a html noob. I deleted and changed the rows and columns randomly to get the last column empty.


    <table align="center" width="759" border="0">
      <table class="thinline" align="center" border="0" cellspacing="1" width="759">
      <td>
      <table width="100%" cellspacing="1">
     <tr class="bgtopic">
                <td width="105" align="left"><strong>Destination</strong></td>
                <td width="108" align="center"><strong>Price</strong></td>
                <td width="44" align="center"><strong>Pop</strong></td>
                <td width="483" align="center"><strong>Info</strong></td>
                 <?php
      $get = $DB->query("SELECT id,name,country FROM $tab[city]  ORDER BY id ASC", __FILE__, __LINE__);
      while ($citys = $DB->fetch_array($get))
            {
            $pop=$DB->fetchone("SELECT COUNT(id) FROM $tab[mob] WHERE city='$citys[id]'", __FILE__, __LINE__);
            $city_count++;  
      ?>
     
              <tr class="topicRow1" id="topicRow1">
                <td width="105" align="left">
                <?php if($citys['id'] != $mob['city']){?>
                <a href="?cty=<?=$citys['id']?>&rnd=<?=$rnd?>">
    			<?=$citys['name']?></a>
                <?php }else{ ?>
                <font color="#CC0000"><strong><?=$citys['name']?></strong></font>
                  <?php }?>
                </td>
                <td align="center">$<?=commas($cost+($pop*5232321));?></td>
                <td align="center">
                  <?=commas($pop)?></td></tr>
               <?php } /*smthi is messed up here witht the last line*/ ?>
               
            
                 
             </table></table>
    HTML:
     
    x0x, Apr 2, 2009 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    <table align="center" width="759" border="0">  <table class="thinline" align="center" border="0" cellspacing="1" width="759">  <td>  <table width="100%" cellspacing="1"> <tr class="bgtopic">            <td width="105" align="left"><strong>Destination</strong></td>            <td width="108" align="center"><strong>Price</strong></td>            <td width="44" align="center"><strong>Pop</strong></td>            <td width="483" align="center"><strong>Info</strong></td>             <?php  $get = $DB->query("SELECT id,name,country FROM $tab[city]  ORDER BY id ASC", __FILE__, __LINE__);  while ($citys = $DB->fetch_array($get))        {        $pop=$DB->fetchone("SELECT COUNT(id) FROM $tab[mob] WHERE city='$citys[id]'", __FILE__, __LINE__);        $city_count++;    ?>           <tr class="topicRow1" id="topicRow1">            <td width="105" align="left">            <?php if($citys['id'] != $mob['city']){?>            <a href="?cty=<?=$citys['id']?>&rnd=<?=$rnd?>">            <?=$citys['name']?></a>            <?php }else{ ?>            <font color="#CC0000"><strong><?=$citys['name']?></strong></font>              <?php }?>            </td>            <td align="center">$<?=commas($cost+($pop*5232321));?></td>            <td align="center">              <?=commas($pop)?></td><td>&nbsp;</td></tr>           <?php } /*smthi is messed up here witht the last line*/ ?>                                         </table></table>
    PHP:
     
    kmap, Apr 2, 2009 IP
  3. x0x

    x0x Well-Known Member

    Messages:
    510
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #3
    That's what I had before. Could there just be one big column? Instead of one per row? Otherwise the big picture wouldn't fit there... So kinda like I showed on the first picture (it will look exactly the same), but there will actually be a column there..
     
    x0x, Apr 2, 2009 IP
  4. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #4
    yes it can be

    <? $count=1; ?> <table align="center" width="759" border="0">  <table class="thinline" align="center" border="0" cellspacing="1" width="759">  <td>  <table width="100%" cellspacing="1"> <tr class="bgtopic">            <td width="105" align="left"><strong>Destination</strong></td>            <td width="108" align="center"><strong>Price</strong></td>            <td width="44" align="center"><strong>Pop</strong></td>            <td width="483" align="center"><strong>Info</strong></td>             <?php  $get = $DB->query("SELECT id,name,country FROM $tab[city]  ORDER BY id ASC", __FILE__, __LINE__);  while ($citys = $DB->fetch_array($get))        {        $pop=$DB->fetchone("SELECT COUNT(id) FROM $tab[mob] WHERE city='$citys[id]'", __FILE__, __LINE__);        $city_count++;    ?>           <tr class="topicRow1" id="topicRow1">            <td width="105" align="left">            <?php if($citys['id'] != $mob['city']){?>            <a href="?cty=<?=$citys['id']?>&rnd=<?=$rnd?>">            <?=$citys['name']?></a>            <?php }else{ ?>            <font color="#CC0000"><strong><?=$citys['name']?></strong></font>              <?php }?>            </td>            <td align="center">$<?=commas($cost+($pop*5232321));?></td>            <td align="center">              <?=commas($pop)?></td><?php if ($count==1) { ?><td rowspan="40">Add pic code here</td></tr>           <?php } $count++;} /*smthi is messed up here witht the last line*/ ?>                                         </table></table> 
    Code (markup):
     
    kmap, Apr 2, 2009 IP
  5. x0x

    x0x Well-Known Member

    Messages:
    510
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Very nice :)

    Just one thing.

    [​IMG]

    This "<tr class="topicRow1" id="topicRow1"> " is a script that changes the row's background on mouse on. As you can see on the picture, the bg also changed for the big column after I dragged my mouse over the first row, which I don't want. It should just be black.. I appreciate your help!
     
    x0x, Apr 2, 2009 IP
  6. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #6
    open the css file of page and look for class "topicRow1"

    Remove on mouse over events in that class

    Regards

    Alex
     
    kmap, Apr 2, 2009 IP
  7. x0x

    x0x Well-Known Member

    Messages:
    510
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #7
    Hehe. I still wanna keep it for the other rows, just not for the big one.
     
    x0x, Apr 2, 2009 IP
  8. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #8
    use

    <?php if ($count==1) { ?><td class="bigrow2" rowspan="40">Add pic code here</td></tr> <?php } $count++;} /*smthi is messed up here witht the last line*/ ?> </table></table>


    Create a new class in css "bigrow2" with everything else except onmouseover in topicrow1
     
    kmap, Apr 2, 2009 IP