Results 1 to 4 of 4

Thread: Table stuctures

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Table stuctures

    Have searched!

    I need an html table built wondering if anybody has a link and some code for this, have 5 incoming variables and want to display them in a fixed table, i also need 7 headers for that table.

    if you have any suggestions then tia.

  2. #2
    Member AWC_Joe's Avatar
    Join Date
    Jan 2006
    Location
    Located
    Posts
    49

    Re: Table stuctures

    You could make a skin/templet:

    Example:
    PHP Code:

    function table_header(){
        
    $html "<table><tr>"
        
    $html .= "<td>Col 1</td><td>Col 2</td><td>Col 3</td>";
        
    $html .= "<td>Col 4</td><td>Col 5</td><td>col 6</td>"
        
    $html .= "<td>col 7</td>";
        
    $html .= "</tr>";
        
        return 
    $html;
    }

    function 
    row($var1="",$var2="",$var3="",$var4="",$var5="",$var6="",$var7=""){
        
    $html "<tr>"
        
    $html .= "<td>" $var1 "</td><td>" $var2 "</td><td>" $var3 "</td>";
        
    $html .= "<td>" $var4 "</td><td>" $var5 "</td><td>" $var6 "</td>."
        
    $html .= "<td>" $var7 "</td>"
        
    $html .= "</tr>";

        return 
    $html;
    }


    # call...
    echo table_header();

    loop
        
    echo row($1var, $2var, $3var, $4var, $5var, $6var, $7var);
    end loop

    echo "</table>"
    Is that what your looking for ?

    If you want to skip a col in a row you wold just do...
    PHP Code:
        echo row($1var, "&nbsp;", $3var, $4var, $5var, "&nbsp;", $7var); 
    And it will add nothing to that cell... you could just use a double quote but the some browser dont like compleatly empty cells so the & n b s p ;works best (im my opion).



    _

    _
    |
    Some programs and scripts ive made: http://wiki.anotherwebcom.com
    What was once an opinion, became a fact, to be later proven wrong...

  3. #3

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: Table stuctures

    thats working to a point but it seems to be adding a row at the top every time the script is run, you see a new dot at the left top hand side on every incoming , so my rows of data are filling up but moving down each time, any idea whats causing this?

  4. #4
    Member AWC_Joe's Avatar
    Join Date
    Jan 2006
    Location
    Located
    Posts
    49

    Re: Table stuctures

    Any chance you can post the code your using to file the table with ?

    or

    Explan in alitlte more detail what you want to do, where your gettin the info form or if your filling the table form a loop.

    You said you need a table with 7 headers and 5 incoming vars... is that gonna be 5 rows which will span 7 columns ?


    _
    |
    Some programs and scripts ive made: http://wiki.anotherwebcom.com
    What was once an opinion, became a fact, to be later proven wrong...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width