According to common sense, just set text-align:center in the tr or td of the parent table to center it. But it is centered in the VS designer, but not in the browser. It's understandable that it's not centered in ff, but it's puzzling even in IE.
If someone says it is inherited from the parent element, then there is nothing written in my parent element There is just one more sentence in the outer table
style="margin-left:auto; margin-right:auto"
Copy after login
Not to mention body . Only the background and foreground colors are set
body { font: normal 9pt auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; color: #4f6b72; background: #E6EAE9; margin:0 auto; }
Copy after login
But the table inside cannot be centered. Please help me analyze it~Thank you
Reply to the discussion (solution)
Solve online! Even a little suggestion will do~
Don’t add center in tr
Add it to td style="text-align:center"
Add it to td Inside style="text-align:center" has the same effect. I tried it earlier
Add styles to the subtable text-align:center will do
According to common sense... You can’t follow common sense
Try it
单位工程数量
总建筑面积
单价(元/平)
小计
合计
大写:
和
不一样,不信你可以试试
Just add display:inline-table; to the table inside. The reason why it could not be centered before was probably because text-align cannot act on block level elements, so it does not work on tables.
Just add display:inline-table; to the table inside. The reason why it couldn’t be centered before was probably because text-align cannot work on blocks... OK, thank you
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn