日期:2014-05-16  浏览次数:20395 次

为什么添加的文本不能居右,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。。。 中间是冒号还是分号?
楼主今后提问请不要直接扔出一段代码,很少有人乐意帮你看完代码的。
------解决方案--------------------
楼上眼力真好