Jump to content

CSS: Table in the center of the page

Recommended Posts

Hello, i am currently using this to make my table appear in the center.<table align="center">...When i look, it works, but the validator suggests to use CSS. I have tried some things like:<table style="align:center"><table style="text-align:center">But none of them seem to work.



What am i doing wrong?Thanks in advance! =D

Link to post
Share on other sites

If single table

<table id="table1">
<table class="table01">
Between <head>....</head>
<style type="text/css">/* '.' Period is for class refefence '.table01', '#' for id reference '#table01' */.table01 { width:95%; margin: 0 auto; }</style>
or external style sheet, just
.table01 {width:95%; margin: 0 auto;}
Edited by dsonesuk
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...