Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Display long span and i on the same line in a table row

I have the following issue, the icon normally should have enough space to go on the same line as the text:

enter image description here

But it doesn’t and I’m not sure what css to use for it:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<tr>
  <td>22/06/2021 15:20:52</td>
  <td>
   <span> 
    The apple is red.
    <i class="fa fa-pencil padding-left-3" />
   </span>
  </td>

If the text is smaller, the icon is displayed nicely on the same line, but if the text is bigger then it just shifts to the next line.

What can be used for it?

>Solution :

To make the icon and text stay on the same line, we can use CSS to set the display property of the container element to "flex". Then, we can use the "align-items" property to center the icon vertically. Here’s some sample CSS code that you can try:

span {
  display: flex;
  align-items: center;
}

This code sets the display property of the span element to "flex", which makes the text and icon align horizontally. The "align-items" property centers the icon vertically within the span element.

I hope this helps! Let me know if you have any other questions.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading