- . . .
( ):
CSS:
table
{
position:relative;
}
td
{
height:300px;
width:300px;
background-color:grey;
}
span
{
top:5px;
right:5px;
position:absolute;
height:100px;
width:100px;
background-color:red;
}
HTML:
<table>
<td style="vertical-align: middle; font-size: 10px;">
<span class="edit-icon glyphicon glyphicon-pencil"> </span>
Content
</td>
</table>
, , .
, , , . , td. . . . , div td, td, . , . . . - block. , , . ( mdn).
, . : -
td display:block , ..content , .transform td, .
CSS:
td
{
position:relative;
display:block;
height:300px;
width:300px;
background-color:grey;
}
span
{
position:absolute;
top:5px;
right:5px;
height:100px;
width:100px;
background-color:red;
}
.content
{
position:absolute;
top:50%;
-webkit-transform:translateY(-50%);
transform:translateY(-50%);
}
HTML:
<table>
<tr>
<td style="font-size: 10px;">
<span class="edit-icon glyphicon glyphicon-pencil"> </span>
<div class="content">
<p>Content</p>
<p>More content</p>
<p>Even more content</p>
<p>So much more content</p>
</div>
</td>
</tr>
<tr>
<td style="font-size: 10px;">
<span class="edit-icon glyphicon glyphicon-pencil"> </span>
<div class="content">
<p>Content</p>
<p>More content</p>
<p>Even more content</p>
<p>So much more content</p>
</div>
</td>
</tr>
</table>