0

How to align an <a> tag with the <details> tag in the same line. For example i want space with <details> in one row. But, if you do so the <details> is going to the next line.

Is there any solution?

<table>
  <tr>
    <td>
      <a>Some Text</a>
      <details>
        <summary></summary>
      </details>
    </td>
  </tr>
</table>
Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Raghavendra M.S
  • 1
  • 1
  • 1
  • 2

1 Answers1

0

You mean this?

It makes the A behave a bit strange unless you also make it a block element

a, details { display:inline-block }
a { float:left; padding-right:3px; }
<table>
  <tr>
    <td>
      <a>Some Text</a>
      <details>
        <summary>Summary</summary>
        <p>Some details</p>
      </details>
    </td>
  </tr>
</table>

Since you are using a table, you can easily fix this

td { vertical-align:top }
<table>
  <tr>
    <td><a>Some Text</a></td>
    <td><details>
        <summary>Summary</summary>
        <p>Some details</p>
      </details>
    </td>
  </tr>
</table>
mplungjan
  • 169,008
  • 28
  • 173
  • 236