SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    mergeing tables with data

    hey folks i m working on a layout in which dynamic data is coming using php the table structure is 5 columns. the right and left sides tables r empty and r having with of 20px and so is b.w column and 2 tables on side r holding data its like this
    |20px|data|20px|data|20px
    that's how my tables are. now the design has change and its like removing the middle 20px width table. the table that hold data has a inline design. so how do i merge it
    All those who wander aren't lost.

  2. #2
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's kind of hard imagining what you're talking about, you don't happen to be able to give us a code snippet?
    Dan G
    Marketing Strategist & Consultant

  3. #3
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a server side issue. The php generates the table. If you're using a templating engine like Smarty, the fix will be trivial. If not, it will depend on how intermingled you've got structure and logic.

    The problem started when you structured the table as 5 fields instead of the 2 you actually have. You're using those empty columns for presentation; that's css's job.

    Your first table should have been a 2 column affair with appropriate style rules.
    Code:
    table {
      border-collapse: separate;
      border-spacing: 20px 0;
      }
    All that would have been required to change the presentation would be to change the styles.
    Code:
    table {
      border-collapse: collapse;
      margin: 0 20px;
      }
    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  4. #4
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question

    Here is tables structure. now the two tables in seprate tr with styles. i wanna combine them. i mean the style shld follow in one table.
    Code HTML4Strict:
    <table width="1050" border="0" cellspacing="0" cellpadding="0">
                                     <tr height="20">
     
                                     <tr>
                                       <td width="20"></td>
     
                                            <td width="487" valign="top" style="background-color:#d5e6f0; border:1px #0064a2 solid;"><table width="487" border="0" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td width="100" class="txt"></td>
                                                <td></td>
                                              </tr>
                                              <tr>
                                                <td width="100" class="txt">Address</td>
                                                <td></td>
                                              </tr>
                                              <tr>
                                                <td class="txt">Type</td>
                                                <td class="textfield"</td>
                                              </tr>
                                              <tr>
                                                <td class="txt">City</td>
                                                <td class="textfield"><</td>
                                              </tr>
                                              <tr>
                                                <td class="txt">From</td>
                                                <td></td>
                                              </tr>
                                              <tr>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                              </tr>
                                            </table></td>
                                            <td width="20">&nbsp;</td>
                                            <td width="487" valign="top" style="background-color:#d5e6f0; border:1px #0064a2 solid;"><table width="487" border="0" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td class="txt">Site Name</td>
                                                <td></td>
                                              </tr>
                                              <tr>
                                                <td width="100" class="txt">Status</td>
                                                <td class=""></td>
                                              </tr>
                                              <tr>
                                                <td class="txt">Category</td>
                                                <td></td>
                                              </tr>
                                              <tr>
                                                <td class="txt">Region</td>
                                                <td></td>
                                              </tr>
                                              <tr>
                                                <td class="txt">To</td>
                                                <td</td>
                                              </tr>
                                              <tr>
                                                <td>&nbsp;</td>
                                                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr>
                                                    <td width="50%">&nbsp;</td>
                                                    <td align="right"><input class="buttons" type="submit" name="Search" value="Search" /></td>
                                                    <td width="70">&nbsp;</td>
                                                  </tr>
                                                  <tr>
                                                    <td>&nbsp;</td>
                                                    <td align="right">&nbsp;</td>
                                                    <td>&nbsp;</td>
                                                  </tr>
                                                  </table></td>
                                              </tr>
                                            </table></td>
                                            <td width="20">&nbsp;</td>
                                          </tr>
                                        </table>
    gary the html tables r static not generated...
    All those who wander aren't lost.

  5. #5
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gary the html tables r static not generated...
    Maybe I got the idea from this:
    hey folks i m working on a layout in which dynamic data is coming using php [emphasis added]
    Why don't you tell us what you're trying to do? Not how you want to do it, but what you want to do. From your example code, I confess I can't buy a clue. But, from the example, there is no reason for a table structure that I see.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  6. #6
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have two tables within a table because you wanted to have a space in between them?

    I suggest you look into CSS to produce any space required for your layout (Gary indicated how in the second code snippet), and only use one table and get rid of any columns that hold no data.

    Maybe I was wrong in asking for a code snippet, I should've asked for a mockup
    Dan G
    Marketing Strategist & Consultant


Bookmarks

Posting Permissions

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