Expandable Tables.

Discussion in 'HTML & Website Design' started by Matt2k6, Dec 11, 2006.

  1. #1
    Hey all, i was wondering if someone could tell me how to code expandable tables.

    Thanks alot.

    Matt
     
    Matt2k6, Dec 11, 2006 IP
  2. Tim_Myth

    Tim_Myth Peon

    Messages:
    741
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Put this code in your header
          function toggle(o)
          {
            var e = document.getElementById(o);
            e.style.display = (e.style.display == 'none') ? 'block' : 'none';
          }
    Code (markup):
    Then give the tables (or table rows) unique ID's and set the onclick event to toggle('table1'). Look at http://www.byrequest.dj/25501/index.html for an example of how I did it.
     
    Tim_Myth, Dec 11, 2006 IP
  3. ednit

    ednit Peon

    Messages:
    152
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can also do this:

    <table width="65%">
    <tr>
     <td>
    <!-- CONTENT -->
     </td>
    </tr>
    </table>
    Code (markup):
    This will resize based on the width of the users browser. . .though I'm not sure if that's what you're looking for. The 65% can be changed to whatever you want, though.
     
    ednit, Dec 11, 2006 IP
  4. TuesZ

    TuesZ Well-Known Member

    Messages:
    934
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    163
    #4
    Make that 100% and it will resize depending on the browser. That's for maximum width at least.
     
    TuesZ, Dec 12, 2006 IP