Jump to content

[SOLVED] Transfer a design from tables to <div>


Solarpitch

Recommended Posts

Hi Guys,

 

When it comes to using div's ... I am not very good at all and tend to do a work around using tables. For the layout I need below the use of tables is very messy and I'd love to pop it into a div design layout.

 

 


~~~~~ Table Code Layout

        echo "<table id='resultsrow' width='600' border='0' cellspacing='0' cellpadding='0'>";
  	echo "<tr>";
    	echo "<td width='120'><div align='left'>Image</div></td>";
    	echo "<td><table border='0' cellspacing='0' cellpadding='0'>";
     	echo "<tr>";
        echo "<td><table border='0' cellspacing='0' cellpadding='0'>";
        echo "<tr>";
        echo "<td width='120'><div align='left'>". $row[2] . "</div></td>";
        echo "<td width='190'><div align='left'>". $row[3] . "</div></td>";
        echo "<td width='140'><div align='center'>". $row[5] . "</div></td>";
        echo "</tr>";
        echo "</table></td>";
      	echo "</tr>";
      	echo "<tr>";
        echo "<td width='450'><div align='left'>". $row[4] . "</div></td>";
      	echo "</tr>";
    	echo "</table></td>";
  	echo "</tr>";
echo "</table>";

 

 

Here's an example of the above design I am looking to achieve.

 

layoutexample.gif

Link to comment
Share on other sites

Well that is more or less tabular data for what you are doing, and tables are designed for tabular data. You can still do it in tables but with much less html:

<table id="resultsrow" width="600" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td rowspan="2" width="120" align="center">Image</td>
    <td align="center" width="120">type</td>
    <td align="center" width="190">address</td>
    <td align="center" width="140">price</td>
  </tr>
  <tr>
    <td colspan="3" width="450" align="center">description</td>
  </tr>
</table>

 

mines 1 whole table vs your three tables.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.