Jump to content

DIV instead of TABLE


crashmaster

Recommended Posts

hi...
I am starting to use DIVs instead of TABLE>.
I have i question ..
I have code in tables
[code]
<table width="643" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="5"><img src="imgs/header.gif" width="643" height="74" /></td>
  </tr>
  <tr>
    <td><img src="imgs/header_left.gif" width="171" height="30" /></td>
    <td><img src="imgs/header_home.gif" width="85" height="30" /></td>
    <td><img src="imgs/header_about.gif" width="79" height="30" /></td>
    <td><img src="imgs/header_portfolio.gif" width="121" height="30" /></td>
    <td><img src="imgs/header_right.gif" width="188" height="30" /></td>
  </tr>
</table>
[/code]

I need to do the same effect but in DIV ///
Can somebody help me ??
Link to comment
https://forums.phpfreaks.com/topic/16141-div-instead-of-table/
Share on other sites

Try something like this:

[code]
<div width="643" border="0" >
<img src="#" width='643' height='74' alt="img0" />
<br>
<img src="#" width="171" height="30" alt="img1" />
<img src="#" width="85" height="30" alt="img2" />
<img src="#" width="79" height="30" alt="img3" />
<img src="#" width="121" height="30" alt="img4" />
<img src="#" width="188" height="30" alt="img5" />
</div>
[/code]

The line break should function the same way as a new tablerow.  If it doesn't, let me know.

-Bryan
Link to comment
https://forums.phpfreaks.com/topic/16141-div-instead-of-table/#findComment-66639
Share on other sites

Try this
<div id="wrapper" style="margin:0px auto;">
<div style="width:643; height:74;" ><img src="#" width='643' height='74' alt="img0" /></div>
<div style="width:643; height:30;padding:0px;" ><img src="#" width="171" height="30" alt="img1" /><img src="#" width="85" height="30" alt="img2" /><img src="#" width="79" height="30" alt="img3" /><img src="#" width="121" height="30" alt="img4" /><img src="#" width="188" height="30" alt="img5" /></div>
</div>

** make sure all of your link images are on one line. IE has problems with new lines when doing something like this.

-Chris
Link to comment
https://forums.phpfreaks.com/topic/16141-div-instead-of-table/#findComment-66657
Share on other sites

[code]<div id="wrapper" style="margin:0px auto;">
<div style="width:643; height:74;" ><img src="#" width='643' height='74' alt="img0" /></div>
<div style="width:643; height:30;padding:0px;" ><img src="#" width="171" height="30" alt="img1" /><img src="#" width="85" height="30" alt="img2" /><img src="#" width="79" height="30" alt="img3" /><img src="#" width="121" height="30" alt="img4" /><img src="#" width="188" height="30" alt="img5" /></div>
</div>[/code]
Actually, no, don't do that. That's bad. It uses inline style definitions and won't solve the problem. Instead, do this:
[code]
<div id="header">
    <div id="header_img"><img src="#" width="643" height="74" alt="img0" /></div>
    <div id="header_img_row"><img src="#" width="171" height="30" alt="img1" /><img src="#" width="85" height="30" alt="img2" /><img src="#" width="79" height="30" alt="img3" /><img src="#" width="121" height="30" alt="img4" /><img src="#" width="188" height="30" alt="img5" /></div>
</div>
[/code]
Then attach this piece of code to your stylesheet:
[code]
div#header_img_row img {
      margin: 0px;
      padding: 0px;
}
[/code]
By doing that, there won't be any spacing to the images.
Link to comment
https://forums.phpfreaks.com/topic/16141-div-instead-of-table/#findComment-66806
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.