<style type="text/css">
.a{
width: 50px;
height: 50px;
background: red;
}
table{
border-collapse: collapse;
position: relative;
}
td{
width: 50px;
height: 50px;
border:1px solid;
}
</style>
</head>
<body>
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td><p class="a" style="left:5![图片描述][1]0px; top: 50px;"></p></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<script type="text/javascript">
var p = document.getElementsByTagName('p')[0];
p.style.left = '20px';
document.write(p.style.left);
</script>

Top, right, left et bottom en CSS doivent être utilisés en combinaison avec position, et la classe parent doit également avoir l'attribut position.
Avez-vous défini l'absolu pour p