Home >Web Front-end >HTML Tutorial >How to write the style of such a question?_html/css_WEB-ITnose
3b8f1349210e228ca9f7b464fc0265a3900cfedad05ac9a7b40ac8d4f189b9fcAAAb90dd5946f0946207856a8a37f441edf
3b8f1349210e228ca9f7b464fc0265a3AAAb90dd5946f0946207856a8a37f441edf
These are two TDs. Some have checkboxes and some don't. Now I want the text part AAA to be centered and aligned
Please change it How to write?
In addition, it is AAA that is aligned when displayed
a34de1251f0d9fe1e645927f19a896e8
3b8f1349210e228ca9f7b464fc0265a397e572cdd253411eeca9025a7d77967bAAAa5a281b23a87bdfc8fbd8592c830129e
a34de1251f0d9fe1e645927f19a896e8
3b8f1349210e228ca9f7b464fc0265a3AAAb90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
Try using margin or absolute positioning
3b8f1349210e228ca9f7b464fc0265a398a82459aeae981b5bb2a4ccbd59e625 AAAb90dd5946f0946207856a8a37f441edf
3b8f1349210e228ca9f7b464fc0265a3 AAAb90dd5946f0946207856a8a37f441edf
LZ only wants AAA alignment, but the checkbox does not affect it, and it is still left aligned , is this the effect?
My final display effect is as long as AAA is aligned horizontally
05c1c892160cb435a95acba12616a964AAA54bdf357c58b8a65c66d7c19c8e4d114
Put on a span and fine-tune it yourself
You have added center to td, you can add a css to control the checkbox and make it float left.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> input{ float:left; } </style> </head> <body> <table width="100%"> <tbody> <tr> <td width="13%" align="center"><input name="Input" type="checkbox" value="" style="margin-left:-20px"/>AAA</td> </tr> <tr> <td width="13%" align="center">AAA</td> </tr> </tbody> </table> </body></html>