0
How to move the table to the center
11 Réponses
0
to achieve this you need to:
1. put the table in a div.container.
2. give the container a width of 100vw or 100%
3. style the container with display:flex; aligning it to align it to the center.
you can easily look up tutorials on flex.
+ 2
Just change align left to center
align = "center"
+ 2
Radwa Hamdy Please don't use align attribute on html tags, it's obsolete HTML center element.
It might not work on new browsers soon.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center
Use text-align: center css instead.
0
Thanks
0
But I changed it and nothing changed
0
Radwa Hamdy You can do one thing put table inside div and make div in center.
0
Ok thanks
0
AJ #Infinity Love It didn't work
0
In order to move the table to the center, this require css .
You can chose to use either the inlineer sheet, internal style sheet or the external style sheet. But I will recommend the external style sheet it keeps ur codes in order.
Use the table as the selector, and the property should be align - text and the value should be center.
Ex. table{
align-text: center
}
0
But when you are running your table in a div you use the Id attributes or the class attributes. in the opening tag of the table in the div
0
Thanks