Is this the right tag to center a table. < Table align:"center"></tabel> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is this the right tag to center a table. < Table align:"center"></tabel>

10th Apr 2022, 12:37 PM
Zanele
Zanele - avatar
12 Answers
+ 5
align="center"
10th Apr 2022, 12:43 PM
SoloProg
SoloProg - avatar
+ 3
yes it will work
10th Apr 2022, 12:41 PM
NonStop CODING
NonStop CODING - avatar
+ 3
try margin: 0 auto; on the table tag
10th Apr 2022, 12:44 PM
NonStop CODING
NonStop CODING - avatar
+ 2
SoloProg oooh man, i did not noticed it's : not =
10th Apr 2022, 12:46 PM
NonStop CODING
NonStop CODING - avatar
+ 2
Try : <table align="center"> <!-- table info--> </table>
11th Apr 2022, 6:39 PM
Icey Python
Icey Python - avatar
+ 2
I usually add a class to the table element and then alter it on CSS by doing this: .classname{ width : 90%; margin-right : 5%; margin-left : 5%; } Or you could just use: .classname{ margin : 0 auto; } Note that for the first example I divided the remaining width by 2 and allocated it evenly between the left margin and the right margin..You can use your own values by the way😄
12th Apr 2022, 6:07 AM
Samson Lukhele
+ 2
I still have to learn CSS, in still busy with html but thank you
12th Apr 2022, 7:19 AM
Zanele
Zanele - avatar
+ 1
Thanks
10th Apr 2022, 12:45 PM
Zanele
Zanele - avatar
+ 1
I saw that mistake
10th Apr 2022, 12:46 PM
Zanele
Zanele - avatar
+ 1
It works
11th Apr 2022, 6:51 PM
Zanele
Zanele - avatar
0
For some reason it doesn't, I did it on notepad ++and it doesn't work, my table is to the left
10th Apr 2022, 12:43 PM
Zanele
Zanele - avatar
0
It did, thank you so much
10th Apr 2022, 5:25 PM
Zanele
Zanele - avatar