Place the HTML button in the lower right corner of the table.

I tried various solutions, but I can’t get them to work, and it’s very difficult for me to think about positioning HTML elements. It should be about as simple as they are. Nonetheless...

NOTE. A button is NOT to be part of a table.

I have a table, and I want to place the button to the right of the table, and the bottom of the bottom of the button is vertically aligned at the bottom of the table.

Edited to provide a basic layout.

<table id="someTable">
  <tr>
    <td>SomeCell</td>
  </tr>
</table>
<button id="somebutton">
  A button
</button>  
+4
source share
3 answers

Managed to make it work.

<div>
  <table id="someTable">
    <tr>
      <td>SomeCell</td>
    </tr>
  </table>
  <button id="someButton">
    A button
  </button>
</div>

#someTable
{
  display: inline-table;
}
#somebutton
{
  display: inline-block;
  vertical-align: bottom;
}

http://jsfiddle.net/Pf9Y7/

+1

:

​​

<table id="someTable">
   <tr>
      <td>Some cell</td>
   </tr>
<tfoot>
   <tr>
      <td valign="bottom" align="right">
        <button id="someButton">
          A button
        </button>
      </td>
   </tr>
</tfoot>
</table>

.....

+2
<table border="1" width="250">
<tr>
    <td>Hello <br/><br/><br/></td>
    <td valign="bottom" align="right"><button type="button">Click Me!</button></td>
</tr>
</table>
0

Source: https://habr.com/ru/post/1529939/


All Articles