0

CSS is my weak side and now I'm trying to improve it, can you please help me to spot what's the problem is, moreover which css style I'm missing. I need to make table like in top picture

<table>
  <tr>
    <td style=width:"177px; height:92px"><img src="logo.png"></td>
    <td rowspan="2"><img src="img2.png"></td>  
  </tr>
  <tr>
    <td style=width:"177px; height:100px"><img src="img1.png"></td>
  </tr>
  </tr>
</table>

UPDATE: I forgot to mention that I was doing HTML email so solved my issue. Thanks for your help

ummahusla
  • 2,043
  • 3
  • 28
  • 42

4 Answers4

1

I think you just need to make the table default CellSpacing and CellPadding 0 (assuming the top picture in your post is the desired result)

 <table cellpadding=0 cellspacing=0 >

Although DIV's may be easier

<div>
  <div style = width:"177px; height:92px; float:left;">
       <img src="logo.png"><br />
       <img src="img2.png">
  </div>
  <div style=width:"177px; height:100px; float:left;">
      <img src="img1.png">
  </div>
</div>

Then, let's take it 1 step further

<style>
.wrapper
{
    background-color:#ccc;
    padding:5px;
}
.content
{
    width:177px; 
    height:100px; /*Made them both 100px although one was 92px, this may not be correct*/
    float:left;
}
</style>


<div class="wrapper">
  <div class="content">
       <img src="logo.png"><br />
       <img src="img2.png">
  </div><!--/content-->
  <div class="content">
      <img src="img1.png">
  </div><!--/content-->
</div><!--/wrapper-->
Dave
  • 8,163
  • 11
  • 67
  • 103
0

The property you are looking for may be border-spacing, E.G. border-spacing: 0; (other table specific CSS properties) however you may wish to consult this topic first: Why not use tables for layout in HTML?

Community
  • 1
  • 1
i_like_robots
  • 2,760
  • 2
  • 19
  • 23
0

Try This one:

css

  table {border:1px solid #ccc; 
 .logo{ width:100px; }.img2{ width:300px } 

HTML

<table cellpadding="0" cellspacing="0">
  <tr>
    <td class="logo">
     <img src="logo.png" /><br />
     <img src="img1.png">
    </td>
    <td class="img2"><img src="img2.png"></td>
  </tr>
 </table>
NikeshPathania
  • 217
  • 2
  • 5
-1

height is the problem. Decrease the height of logo.png image.

Vivek Kumar
  • 1,204
  • 4
  • 15
  • 35