3

slds table

Hi,
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">
     <thead>...</thead>
     <tbody>
      <tr> [td in the middle of the cell] </tr>
     </tbody>
    </table>

I hope someone can help me. Thanks!

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

1 Answer 1

4

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .