Skip to content

Instantly share code, notes, and snippets.

@joshamburn
Created January 13, 2015 02:15
Show Gist options
  • Select an option

  • Save joshamburn/f40b61038d8eb4dd0237 to your computer and use it in GitHub Desktop.

Select an option

Save joshamburn/f40b61038d8eb4dd0237 to your computer and use it in GitHub Desktop.
Split vertical alignment of two elements in a parent
<table>
<thead>
<tr>
<th>
<span>Column One</span>
<input type="text"/>
</th>
</tr>
</thead>
<tbody>
<tr><td>stuff</td></tr>
</tbody>
</table>
table {
border-collapse: collapse;
margin: 100px auto;
}
th {
background: pink;
border: 1px solid black;
height: 100px;
width: 120px;
}
th {
position: relative;
}
th span {
position: absolute;
top: 0;
}
th input {
position: absolute;
bottom: 0;
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment