isme
isme

Reputation: 190

How do I align button in a table according to the previous button

How do I shift a button to align with the button on the right as follows:

enter image description here

The html as follows:

<table>
  <tr>
    <td>
      <h4> Search: </h4>
    </td>
    <td>
      <input type="text" />
    </td>
    <td>
      <button type="submit" name="abc" form="submitForm" value="Button">Button</button>
    </td>
  </tr>
  <tr>
    <td class="customView">
      <button type="submit" name="def" form="submitForm" value="Button">Button</button>
    </td>
  </tr>
</table>

Upvotes: 1

Views: 86

Answers (2)

Imran Mohammed
Imran Mohammed

Reputation: 228

<table>
  <tr>
    <td>
      <h4> Search: </h4>
    </td>
    <td>
      <input type="text" />
    </td>
    <td>
      <button type="submit" name="abc" form="submitForm" value="Button">Button</button>
    </td>
  </tr>
  <tr>
  <td colspan="2"></td>
    <td class="customView">
      <button type="submit" name="def" form="submitForm" value="Button">Button</button>
    </td>
  </tr>
</table>

Upvotes: 1

ADH - THE TECHIE GUY
ADH - THE TECHIE GUY

Reputation: 4393

add colspan="3" , align="right" to your <td> tag it's work fine,I'm added the snippet below.

<table>
          <tr>
            <td><h4> Search: </h4></td>
            <td><input type="text"/> </td>
            <td><button type="submit" name="abc" form="submitForm" value="Button">Button</button></td>
          </tr>
          <tr  >
             <td class="customView" colspan="3" align="right"><button type="submit" name="def" form="submitForm" value="Button">Button</button></td>
          </tr>
     </table>

Upvotes: 1

Related Questions