Place DIV element next to SPAN element inside parent TD

Issue

I am struggling to place a div element next a span element inside parent .

Currently element is getting display belove the span element. I need it to display next to span element.

Here is HTML structure I am using:

<td>
  <a align="right"><img></a>
  <a align="right"><img></a>
  <img>
  <a><img></a>
  <span id="labelSpan">test</span>
  <div id="headerDiv" style="margin-left:150px;">
    <table><tbody><tr><td></td></tr></tbody></table>
  </div>
</td>

An additional requirement is that I need to set margin of div element with respect to parent td element not span element.

Please advise.

Thanks!

Solution

Try:

div {
    display: inline;
}

This will make the div an inline element like the span and the two will sit side by side. You’ll probably need to change the display of the table as well.

Answered By – j08691

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.