html-tablevertical-alignmentbaseline

Align first row of text in table to baseline of surrounding text


Is there a way to align the text inside a table to surrounding text? I cant find a question like this anywhere. Seems like it should be do-able without having to resort to replacing the table with divs.

baseline surrounding text here <table style="display: inline-block; background-color: rgba(20,30,40,0.5);"><tr><td>align me to baseline</td></tr><tr><td>abc</td></tr><tr><td>def</td></tr></table>

What I'm trying to achieve:

enter image description here


Solution

  • baseline surrounding text here <table style="border-spacing: 0px; display: inline-block; vertical-align: top; background-color: rgba(20,30,40,0.5);"><tr><td>align me to baseline</td></tr><tr><td>abc</td></tr><tr><td>def</td></tr></table>