如何将表格单元格内的iframe元素与表格中其余的表格单元格对齐,以便在它是td元素时以相同的方式显示。 ?
我尝试通过添加内联样式位置来对齐:relative;顶部:-4px到iframe元素。
//Not working in Samsung Device
MediaPlayer mMediaPlayer;
void playSound()
{
try {
mMediaPlayer = MediaPlayer.create(this, R.raw.recipe_tune);
mMediaPlayer.start();
} catch (Exception e) {
// TODO: handle exception
}
}
我认为这不是正确的方法。有没有其他方法可以对齐它?
主要Html
<iframe src="Static/Pan.htm" frameborder="0" scrolling="no" width="190" height="30" style="width: 190px;height: 30px; display:table-cell; position:relative; top:-4px"></iframe>
Iframe Address.htm
<table id="mytable">
<tr>
<td>Name
</td>
<td>Phone Number
</td>
<td>Address
</td>
<td></td>
</tr>
<tr>
<td>
<input type="text" />
</td>
<td>
<iframe src="Address.htm" frameborder="0" scrolling="no" width="190" height="30" style="width: 190px;height: 30px; display:table-cell;"></iframe>
</td>
<td>
<input type="text" />
</td>
<td>
<input type="button" value="update" />
</td>
</tr>
</table>
答案 0 :(得分:0)
像这样定位所需的细胞:
td {
vertical-align: top;
}
这会将您的单元格内容与单元格的顶部对齐。