Table align = "center" doesn't seem to work

+6
source share
5 answers

You need to set this on the <td> elements.

You should also use text-align: center in css, not align = "center" in html.

+8
source

If you want the center of the table to use:

.content-table { margin: 0 auto; } 

if you want to use centered text td:

 .content-table td { text-align: center; } 
+6
source

while there are many ways to do with css, divs and style property etc. the easiest way is not to use align = "center", but to wrap the table in the <center> </center> :)

Note: The center element is deprecated in HTML5 .

+1
source

there are two things you need to do

  • need to have width in pixels or%

  • margin: 0 auto; or in margin-left: auto and margin-right: auto

    .search-box table {height: 100%; width: 50%; margin: auto; }

+1
source

You should use a CSS selector with the align = "center" attribute, as shown below:

 table[align="center"] { margin: 0 auto; } 
0
source

Source: https://habr.com/ru/post/895317/


All Articles