• javascript获取表格的高度


    <!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>
        <title>用户管理页面</title>
        <style type="text/css">
                 #tbAdd td
            {
                padding: 10px;
            }
            #tbAdd
            {
                border: 1px solid #000;
                300px;
                height:150px;
                background-color: #fff;
                border-collapse: collapse;
                position: absolute;
            }
             </style>
          <script type="text/javascript">
                   }
            window.onload = function () {
                           AdjustAddTableLocation("tbAdd");
            }
            //调节添加用户的table的位置
            function AdjustAddTableLocation(tbAddid) {
                var tbAdd = GetControl(tbAddid);

    //alert(tbAdd.style.height);//这里弹出的为空的  获取不到
                alert(tbAdd.offsetWidth); //这里弹出表格的宽度

    tbAdd.style.left = window.innerWidth / 2 - (tbAdd.offsetWidth / 2)+"px"; //为他设置值时切记要加"px",否则没效果
                  }
        </script>
    </head>
    <body>
        <table id="tbAdd">
            <tr>
                <td>
                    <label for="txtUserName">
                        用户名</label>
                </td>
                <td>
                    <input type="text" id="txtUserName" />
                </td>
            </tr>
            <tr>
                <td>
                    是否启用
                </td>
                <td>
                    <input type="radio" id="radioStatus" value="true" />启用
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button" id="rbtSure" value="确定" />
                    <input type="button" id="btnCancel" value="取消" />
                </td>
            </tr>
        </table>
    </body>
    </html>

  • 相关阅读:
    Webpack 打包 14. html压缩
    webpack优化环境配置 18.HMR
    Webpack 打包 10. 压缩CSS
    Wenpack 打包 15. 生产环境配置(提取JS中的CSS、压缩CSS、压缩html、eslint语法检查...)
    Webpack 打包 13. 压缩JS
    webpack优化环境配置 17.优化配置介绍
    Webpack 打包 11. eslint 语法检查
    AtCoder Beginner Contest 258
    AtCoder Beginner Contest 259
    AtCoder Beginner Contest 261
  • 原文地址:https://www.cnblogs.com/xiexingen/p/2708965.html
Copyright © 2020-2023  润新知