slds table

I want to create a table in my lightning component. I created 2 lightning:input fields and want to change the vertical alignment to "middle" but it does not work.

I tried to do the following:

<td  class="slds-align-middle"><lightning:input /></td>

and this:

<td><span class="slds-align-middle"><lightning:input /></span></td>

and this:

<td Style="text-align: center;vertical-align:top;" valign="middle"><lightning:input /></td>

I am using slds:

    <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-table_col-bordered">
      <tr> [td in the middle of the cell] </tr>

I hope someone can help me. Thanks!

  • It is because lightning:input attribute label is Required , so Its creating a empty label tag in DOM
    – vignesh
    Oct 12 '18 at 10:36
  • 1
    try using <lightning:input variant="label-hidden">
    – Ranga
    Oct 12 '18 at 12:54

Use <lightning:input variant="label-hidden"> to have lightning input without a space in front.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.