Home > Web Front-end > HTML Tutorial > Why can't td Chinese characters be right aligned_html/css_WEB-ITnose

Why can't td Chinese characters be right aligned_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:22:25
Original
1240 people have browsed it

The code is as follows:

<table style="width:100%; border-collapse:collapse; border:1px solid rgb(220,220,220);">				<tr style="height:30px; width:100%;">					<td style="width:100px; text-align:right;">						物品名称:					</td>					<td style="text-align:left; width:300px;">						<input id="productName" name="productName" type="text" maxLength="30" value="${productName}" class="input_2"/>					</td>				</tr>			</table>
Copy after login

Among them,
<td style="width:100px; text-align:right;">						物品名称:					</td>
Copy after login

I want the item name to be on the right, but I added text-align:right; it is still centered. The screenshot is as follows:


What is the problem? Please tell me


Reply to the discussion (solution)

 <td style="text-align:left; width:300px;">                        <input id="productName" name="productName" type="text" maxLength="30" value="${productName}" class="input_2"/>                    </td>
Copy after login



This It’s on the right



<html><table style="width:500px; border-collapse:collapse; border:1px solid rgb(220,220,220);">				<tr style="height:30px; width:100%;">					<td style="width:200px; text-align:right;">						物品名称:					</td>					<td style="text-align:left; width:300px;">						<input id="productName" name="productName" type="text" maxLength="30" value="${productName}" class="input_2"/>					</td>				</tr>			</table></html>
Copy after login


<!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">	<table style="width:100%; border-collapse:collapse; border:1px solid rgb(220,220,220);">                <tr style="height:30px; width:100%;">                    <td width="100px" align="right">                        物品名称:                    </td>                    <td align="left" width="300px">                        <input id="productName" name="productName" type="text" maxLength="30" value="${productName}" class="input_2"/>                    </td>                </tr>            </table></html>
Copy after login

<TD align=right>
Copy after login

Suggestion Use the chrome browser to debug and check whether TD has set other styles.
In addition, you can easily modify the style in chrome for instant preview!

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