0
How to align table
My table is not aligning to center. By default it is left aligned. It gets aligned to right from table tag but not gets center aligned. Is it not supported in HTML5. https://code.sololearn.com/WwNxu2eb63pT/?ref=app
5 Respostas
+ 2
use css, center tag is obsolete.
table{
margin:auto;
}
+ 2
You could use inline styles to set margin: auto.
<table align="center" border-spacing="0" border="6" style="margin: auto">
Unrelated to your question, strongly consider the following:
- It is nicer to use CSS instead of HTML's old formatting attributes.
- Fix your invalid whitespace characters. Look at Sololearn's code editor and fix those dots. You shouldn't have any "x" marks in the code editor.
+ 2
html5 aside. it seems that <center> are missing. but the closing tag </center> exist
adding <center> before <table> should take it to the center
even if its working, consider to move to current standard with html5 and css3.
+ 1
Good . Thank! got it
+ 1
That's correct. The centre tag was deliberately deleted to check wheather table tag's align="center" attribute works or not.