-2

I am trying to align my table to centre of the webpage and I wam using align="right","centre" but non of them working,can some one point me in setting the table position!

    <table style="table-layout:fixed;" align="right" cellspacing="2" border="0" cellpadding="0" id="Table_User" runat="server" >
         <tbody>
             table fields
         </tbody>   
    </table>

Thanks

DaFois
  • 2,197
  • 8
  • 26
  • 43
RamSP
  • 21
  • 1
  • 4
  • 3
    why are you putting `align="right"` in the table element if you want to center it? – DaFois Dec 06 '18 at 14:19
  • You've provided a live demo. Click the "Run code snippet". Look at the result. The code you've provided is littered with random `>` characters and has no table cells. Try providing a real [mcve] – Quentin Dec 06 '18 at 14:23

2 Answers2

-1

You can just use

<center>
<table....>


</table>
</center>
  • 1
    (HTML 5) Element 'centre' is not supported. I have tried earlier and I am getting this message – RamSP Dec 06 '18 at 14:11
  • @RamSP Because it would be `center` and not `centre`. This is also outdated: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center – DasSaffe Dec 06 '18 at 14:25
  • [The
    tag is obsolete](https://html.spec.whatwg.org/dev/obsolete.html#obsolete)
    – Rob Dec 06 '18 at 14:29
-1

`It is true the center tag is deprecated Use this CSS and modify per your choice:

.center { margin: auto; width: 60%; padding: 10px; }
OneGhana
  • 119
  • 5
  • You are not wrong, but the `center` tag is deprecated. See this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center – DasSaffe Dec 06 '18 at 14:24
  • @DasSaffe The `
    ` tag is [obsolete](https://html.spec.whatwg.org/dev/obsolete.html#obsolete), not just deprecated.
    – Rob Dec 06 '18 at 14:27