Jump to content

CSS: Table in the center of the page


Sunamena

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 comment
Share on other sites

If single table

<table id="table1">
Multiple
<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 comment
Share on other sites

<table style="align:center"> is not a valid definition

<table style="text-align:center"> is only for the text inside the table not the table itself.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...