Tryit Editor v1.4

<html> <head> <script type="text/javascript"> function alignCell() { document.getElementById('td1').align="right"; } </script> </head> <body> <table border="1"> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td id="td1">Peter</td> <td id="td2">Griffin</td> </tr> </table> <br /> <input type="button" onclick="alignCell()" value="Align cell" /> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself