首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

为什么添加的文本不能居右,style不起作用解决方法

2012-03-14 
为什么添加的文本不能居右,style不起作用htmlheadmetahttp-equiv Content-Type content text/ht

为什么添加的文本不能居右,style不起作用
<html>

<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<meta   name= "GENERATOR "   content= "Microsoft   FrontPage   4.0 ">
<meta   name= "ProgId "   content= "FrontPage.Editor.Document ">
<title> New   Page   1 </title>
<script   language=javascript>
function   AddCell()
{
var   vTb   =   document.getElementById( "tbSum ");

var   vRow   =   vTb.insertRow();

var   vCell   =   vRow.insertCell();
vCell.innerHTML   =   " <input   type= 'text '   id= 'WSumCellMax '   size= '8 '   value= '济南 '     style= 'align:center;font:10;height:12:TEXT-ALIGN:   right;BORDER-TOP-STYLE:   none;   BORDER-RIGHT-STYLE:   none;   BORDER-LEFT-STYLE:   none;   BORDER-BOTTOM-STYLE:   none;BORDER-BOTTOM-STYLE:   none '> ";
var   vCell   =   vRow.insertCell();
vCell.innerHTML   =   " <input   type= 'text '   id= 'WSumCellMax '   size= '8 '   value= '青岛 '     style= 'align:center;font:10;height:12:TEXT-ALIGN:   right;BORDER-TOP-STYLE:   none;   BORDER-RIGHT-STYLE:   none;   BORDER-LEFT-STYLE:   none;   BORDER-BOTTOM-STYLE:   none;BORDER-BOTTOM-STYLE:   none '> ";

}
</script>
</head>

<body>

<table   border= "1 "   id= "tbSum "   cellpadding= "0 "   cellspacing= "0 "   width= "100% ">
    <tr>
        <td   width= "50% ">   </td>
        <td   width= "50% ">   </td>
    </tr>
</table>
<input   type= "button "   id= "dd "   onclick= "AddCell() "   value= "添加 ">
</body>

</html>


[解决办法]
仔细看看。。。12:TEXT-ALIGN。。。 中间是冒号还是分号?
楼主今后提问请不要直接扔出一段代码,很少有人乐意帮你看完代码的。
[解决办法]
楼上眼力真好

热点排行
Bad Request.