textalign javascript
document.getElementById("myID").style.textAlign = "center";
ayaan
document.getElementById("myID").style.textAlign = "center";
document.getElementById("demo").style.textAlign = "left|right|center|justify|initial|inherit";
// from w3school