Sunamena Posted October 25, 2015 Share Posted October 25, 2015 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 More sharing options...
Ingolme Posted October 25, 2015 Share Posted October 25, 2015 If the table has a specified width set the margin to "0 auto" Link to comment Share on other sites More sharing options...
funbinod Posted October 28, 2015 Share Posted October 28, 2015 style="width:95%; margin-left:auto; margin-right:auto;" Link to comment Share on other sites More sharing options...
dsonesuk Posted October 29, 2015 Share Posted October 29, 2015 (edited) 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 October 29, 2015 by dsonesuk Link to comment Share on other sites More sharing options...
doteweb Posted November 1, 2015 Share Posted November 1, 2015 <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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now