How to write the style of such a question?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:19:13
Original
833 people have browsed it

AAA
AAA

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?


Reply to the discussion (solution)

In addition, it is AAA that is aligned when displayed


AAA

AAA

Try using margin or absolute positioning

AAA
AAA
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

AAA

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>
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template