you just need to add this line of code in your tag(<p>; h1, h2, td etc):
<p align="center">sample text<p/>
<style>
p {
text-align: center;
}
</style>
<html>
<p>Some Text</p>
</html>
<p style="text-align: center;"> Center Align </p>
text-align: center;
<!-- various ways -->
<h1 id="one">Let's center this text as an example</h1>
<!-- here we can use three basic centering types -->
<!-- 1st one is <center></center> inside HTML -->
<center>
<h1>Let's center this text as an example</h1>
</center>
<!-- 2nd is the align='center' -->
<h1 align="center">Let's center this text as an example</h1>
<!-- 3rd one is in CSS where we use text-align: center; -->
<style>
#one {
text-align: center;
}
</style>
<!-- OR inside div -->
<div style="text-align:center">
<h1>Let's center this text as an example</h1>
</div>
text-align: center;
With the aid of internal or external CSS you can center text with:
text-align: center;
<center>Dieser Text wird zentriert.
<p>Ebenso dieser Paragraph.</p></center>