2023年3月10日 星期五

V80204A: - 匯出時,不分頁,資料全取 ,[工作中心報工匯出]鈕 – c# 子視窗呼叫 Master的函式(*.cs)

 目的: V80204: [工作中心報工匯出] – c# 子視窗呼叫 Master的函式(*.cs)

處理說明: 1>*.cs 
          //匯出時, 不分頁(par_paging=false), 資料全取 
            V80204APIController V80204 = new V80204APIController();
            DataSet ds = V80204.getGridData_M(false);



1>*.cs
 [HttpPost]
        public void WC_ALS_OutFile()
        {
            var c = HttpContext.Current;
            NameValueCollection nvc = c.Request.Form;

            //匯出時, 不分頁(par_paging=false), 資料全取 
            V80204APIController V80204 = new V80204APIController();
            DataSet ds = V80204.getGridData_M(false);
            //DataSet ds = null;

            string Tmp_FName = nvc["FName"];   //含 *.xls
            string Tmp_sub1_WC = nvc["sub1_WC"];
            //string fName = Tmp_FNAME + ".xlsx";
            string fName = Tmp_FName;
            Workbook wk = null;
            MemoryStream stream = new MemoryStream();
            string Tmp_Str = "";
            string Tmp_Sql = "";
            int Tmp_Cnt = 0;
            try
            {
                wk = new Workbook();
                Worksheet sheet1 = wk.Worksheets[0];//獲取第一個工作表
                //共 9 欄
                //AMM單號 工號  件號 件號名稱    製程 製程資料內容  WBS 工單類型    數量 單位  EOECN 專案  機號 起始值 情況處理碼 工單報工統計(小時)  工作中心 工作中心報工統計(小時)    版本
                string[] outFieldArray = { "項次","AMM單號","工號", "件號", "件號名稱", "製程",
                                                             "製程資料內容", " WBS", "工單類型", "數量", "單位",
                                                             "EOECN", "專案","機號","起始值","情況處理碼",
                                          "工單報工統計(小時)","工作中心","工作中心報工統計(小時)"," 版本" };
                for (int i = 0; i < outFieldArray.Length; i++)
                {
                    sheet1.Range[myfunc.GetExcelPos(i, 0)].Text = outFieldArray[i];
                }
                DataTable dt = ds.Tables[1];
                Tmp_Cnt = dt.Rows.Count;
                //Tmp_Str = "已匯出完成!!  ("+Tmp_Cnt.ToString() +"筆) ";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sheet1.Range[myfunc.GetExcelPos(0, i + 1)].Text = String.Format("{0:d}", i + 1);
                    //sheet1.Range[myfunc.GetExcelPos(1, i + 1)].Text = String.Format("{0:yyyy/MM/dd}", DateTime.Parse(dt.Rows[i]["DT"].ToString())); };
                    // "AMM單號","工號", "件號", "件號名稱", "製程",
                    sheet1.Range[myfunc.GetExcelPos(1, i + 1)].Text = dt.Rows[i]["AMMNO"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(2, i + 1)].Text = dt.Rows[i]["SAPNO"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(3, i + 1)].Text = dt.Rows[i]["PN"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(4, i + 1)].Text = dt.Rows[i]["PNNAME"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(5, i + 1)].Text = dt.Rows[i]["MKNO"].ToString();
                    //"製程資料內容", " WBS", "工單類型", "數量", "單位",
                    sheet1.Range[myfunc.GetExcelPos(6, i + 1)].Text = dt.Rows[i]["MKDESCPT"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(7, i + 1)].Text = dt.Rows[i]["WBS"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(8, i + 1)].Text = dt.Rows[i]["SROTP"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(9, i + 1)].Text = dt.Rows[i]["QTY"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(10, i + 1)].Text = dt.Rows[i]["UNIT"].ToString();
                    //"EOECN", "專案","機號","起始值","情況處理碼",
                    sheet1.Range[myfunc.GetExcelPos(11, i + 1)].Text = dt.Rows[i]["ECNO"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(12, i + 1)].Text = dt.Rows[i]["PROJID"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(13, i + 1)].Text = dt.Rows[i]["ACNO_"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(14, i + 1)].Text = dt.Rows[i]["STARTVAL"].ToString();
                    sheet1.Range[myfunc.GetExcelPos(15, i + 1)].Text = dt.Rows[i]["CNDPROCCODE"].ToString();
                    // "工單報工統計(小時)","工作中心","工作中心報工統計(小時)"," 版本" 
                    sheet1.Range[myfunc.GetExcelPos(16, i + 1)].Text = dt.Rows[i]["ALS_HR_"].ToString();
                    //sheet1.Range[myfunc.GetExcelPos(17, i + 1)].Text = dt.Rows[i]["CURR_ARBPL_"].ToString(); //目前工作中心
                    sheet1.Range[myfunc.GetExcelPos(17, i + 1)].Text = Tmp_sub1_WC; //子視窗.工作中心                    
                    //工作中心報工統計(小時)
                    Tmp_Sql = "  SELECT round((sum(HOUR_WORK)+sum(HOUR_OT))/60,2)  WCHR  "
                                     + "  FROM   "
                                     + "  (  "
                                     + "    SELECT  JCN, ACT, WC, HOUR_WORK, work_ID, HOUR_OT FROM  HOUR.ALS_HOUR_COMP@ALS_HOUR WHERE WC = " + myfunc.AA(Tmp_sub1_WC) + "   AND JCN = '0000' || " + myfunc.AA(dt.Rows[i]["SAPNO"].ToString())
                                     + "    union all   "
                                    + "     SELECT  JCN, ACT, WC, HOUR_WORK, work_ID, HOUR_OT FROM HOUR.ALS_HOUR_COMP_HISTORY@ALS_HOUR WHERE WC = " + myfunc.AA(Tmp_sub1_WC) + "   AND JCN = '0000' || " + myfunc.AA(dt.Rows[i]["SAPNO"].ToString())
                                    + "   )   "
                                    + "  GROUP BY JCN,WC   ";
                    Tmp_Str = myfunc.SqlValue(Tmp_Sql);
                    sheet1.Range[myfunc.GetExcelPos(18, i + 1)].Text = Tmp_Str; //工作中心報工統計(小時)                   
                    //版本
                    Tmp_Sql = "  SELECT  ED   "
                                   + "   FROM    AMM_EDLST  "
                                   + "   WHERE (AMMNO, ITM) in (select AMMNO, max(to_number(ITM)) from AMM_EDLST group by AMMNO )  "
                                   + "   AND AMMNO = " + myfunc.AA(dt.Rows[i]["AMMNO"].ToString());
                    Tmp_Str = myfunc.SqlValue(Tmp_Sql);
                    sheet1.Range[myfunc.GetExcelPos(19, i + 1)].Text = Tmp_Str; //版本


                    // end of for 
                }  // end of   for (int i = 0; i < dt.Rows.Count; i++)
                sheet1.AllocatedRange.AutoFitColumns();
                wk.SaveToStream(stream, FileFormat.Version2007);
            } //end of try
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            finally
            {
                wk.Dispose();
            }

            //Tmp_Cnt = 6;
            Tmp_Str = "已匯出完成!!  (" + Tmp_Cnt.ToString() + "筆) <br>"
                            + "檔案名稱(" + Tmp_FName + ")";
            HttpCookie MyCookie = new HttpCookie("EX_DFile", HttpUtility.UrlEncode(Tmp_Str));
            HttpContext.Current.Response.Cookies.Add(MyCookie);
            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=\"" + HttpUtility.UrlEncode(fName, System.Text.Encoding.UTF8) + "\"");
            HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
            HttpContext.Current.Response.BinaryWrite(stream.ToArray());
            HttpContext.Current.Response.End();
        }    // end of ExportdFile


2>*.js
//工作中心報工匯出
function WC_ALS_OutFile() {
    var np = s_JSON('s_form'); //TMFunction.js, 組合form上的查詢條件為json參數傳遞
    np["FName"] = "V80204_工作中心報表匯出.xlsx";
    np["sub1_WC"] = Ext.getCmp("sub1_WC").getValue();
    console.log("np:", np);
    console.log("FName: ", np.FName);
    f_downloadFile('EX_DFile', '../api/V80204AAPI/WC_ALS_OutFile', np, 'POST', function () {
        var r = r_cookies('EX_DFile');
        mysuccessalert(r);
    });
};

2023年3月7日 星期二

V80204 – Detail *2 -[工作中心報工工時] [報工明細]頁 - 工時格式化 - WebService - Tab

 目的: V80204 –  Detail *2  -[工作中心報工工時] [報工明細]頁     -  .工時格式化:   小數2位

處理說明: 1>Master       -   selectionchange event
                                               Ext.getCmp('grid_M').on("selectionchange", function (view, selections, options) {
                                                         if (selections.length == 0) {
                                                                 return;
                                                              }
                                                     //1>>開啟  grid_D
                                                       var Tmp_store = Ext.getCmp('grid_D').store;
                                                       Tmp_store.getProxy().extraParams = np;
                                                      Tmp_store.getProxy().url = "../api/V80204API/getGridData_D";
                                                      Tmp_store.loadPage(1);

                                          2>格式化: 工時小數位2位     -    後端處理[HOUR_WK_][HOUR_OT_]
                                                         DataRow dr = ds.Tables["T1"].Rows[i];
                                                        Tmp_HOUR_WORK = double.Parse(dr["HOUR_WORK"].ToString());
                                                        Tmp_HOUR_OT = double.Parse(dr["HOUR_OT"].ToString());
                                                        dr["HOUR_WORK_"] = Tmp_HOUR_WORK.ToString("0.00");
                                                       dr["HOUR_OT_"] = Tmp_HOUR_OT.ToString("0.00");





1>*.js  - V80204
 //Detail    加入 [報工明細]頁
  var grid_D1 = Ext.create('grid_D', {
        grid_id: 'grid_D1',
        insert_btn_id: 'btn_add_D1',
        columns: J_columns_D1,
        title: '報工明細',
        store: Ext.create('gridstore_D', { model: J_gridmodel_D1 }),
        //form_items: J_formFields_D1,
        //form_id: 'myform_D1'
    });

    Ext.getCmp('tab_D').add(grid_D1); 

Ext.getCmp('grid_M').on("selectionchange", function (view, selections, options) {
        //MD_DB.reloadDetailStore(selections[0]);
        console.log("selections.length: ", selections.length);
        if (selections.length == 0) {
            return;
        }
           
        var Tmp_rec = selections[0];
        console.log("Tmp_rec: ", Tmp_rec);
        var Tmp_SAPNO = Tmp_rec.data["SAPNO"];
        var Tmp_WC = Tmp_rec.data["CURR_ARBPL_"];        
        console.log("Tmp_SAPNO: ", Tmp_SAPNO);
        console.log("Tmp_WC: ", Tmp_WC);
        var np = {};
        np["SAPNO"] = Tmp_SAPNO;
        np["WC"] = Tmp_WC;        

        //2>開啟  grid_D
        var Tmp_store = Ext.getCmp('grid_D').store;
        Tmp_store.getProxy().extraParams = np;
        Tmp_store.getProxy().url = "../api/V80204API/getGridData_D";
        Tmp_store.loadPage(1);

        //2>開啟  grid_D1
        console.log("open grid_D1.. ");
        Tmp_store = Ext.getCmp('grid_D1').store;
        Tmp_store.getProxy().extraParams = np;
        Tmp_store.getProxy().url = "../api/V80204API/getGridData_D1";
        Tmp_store.loadPage(1);
    });



2> *.cs
//Detail - [工作中心報工工時]頁  - WebService 傳回資料  - WS_ALS_WS01
        [HttpPost]
        public dynamic getGridData_D()
        {
            var c = HttpContext.Current;
            NameValueCollection nvc = c.Request.Form;
            OracleCommand cmd = new OracleCommand();
            string Tmp_SAPNO = nvc["SAPNO"];
            string Tmp_WC = nvc["WC"];
            //string Tmp_SAPNO = "22569801";
            //string Tmp_WC = "";
            DataSet ds = myfunc.getWS_ALS_WS01(Tmp_SAPNO,Tmp_WC);

            int Tmp_Cnt = ds.Tables["T1"].Rows.Count;
            double Tmp_MIN = 0;
            double Tmp_HOUR_ = 0;
            ds.Tables["T1"].Columns.Add(new DataColumn("HOUR_", typeof(string)));
            for (int i = 0; i < Tmp_Cnt; i++)
            {
                //施工人數/施工工時/施工步序                
                DataRow dr = ds.Tables["T1"].Rows[i];
                Tmp_MIN = double.Parse(dr["HOUR"].ToString());
                Tmp_HOUR_ = (Tmp_MIN / 60);
                dr["HOUR_"] = Tmp_HOUR_.ToString("0.00");                
            }  // end of  for (int i=0
            return ds;
        }


        //Detail1 - [報工明細]頁  - 工時.小數格式化
        [HttpPost]
        public dynamic getGridData_D1(bool par_paging = true)
        {
            var c = HttpContext.Current;
            NameValueCollection nvc = c.Request.Form;
            OracleCommand cmd = new OracleCommand();
            string Tmp_SAPNO = nvc["SAPNO"];
            string Tmp_WC = nvc["WC"];            

            string Tmp_Sql = "SELECT RNK, JCN, ACT, WC, CAST(HOUR_WORK as decimal(3, 2)) HOUR_WORK,CAST(HOUR_OT as decimal(3, 2)) HOUR_OT, DATA_DATE, EMPLYNM "
                                       + "FROM   (SELECT  dense_rank()  over(order by  JCN,ACT) as RNK,"
                                                       + "    a.JCN,a.ACT,a.WC,round(a.HOUR_WORK/60,2) HOUR_WORK,  "
                                                       + "     round(a.HOUR_OT / 60, 2) HOUR_OT,a.DATA_DATE,b.EMPLYNM  "
                                                   + " FROM (   SELECT   JCN, ACT, WC, HOUR_WORK, work_ID, HOUR_OT, DATA_DATE  "
                                                                     + "    FROM    HOUR.ALS_HOUR_COMP @ALS_HOUR  "
                                                                     + "    WHERE  JCN = LPAD(" + myfunc.AA(Tmp_SAPNO) + ", 12, 0)  "
                                                                     + "  union all   "
                                                                 + "   SELECT    JCN, ACT, WC, HOUR_WORK, work_ID, HOUR_OT, DATA_DATE  "
                                                                     + "   FROM     HOUR.ALS_HOUR_COMP_HISTORY @ALS_HOUR  "
                                                                     + "   WHERE   JCN = LPAD(" + myfunc.AA(Tmp_SAPNO) + ", 12, 0)  "
                                                                     + "    ORDER  BY   ACT, WC  "
                                                                     + " ) a, HR_EMPLYM b   "
                                                      + " WHERE   a.WORK_ID = b.EMPLYID(+)  "
                                                      + "  ORDER   BY  a.ACT  ";
            Tmp_Sql = Tmp_Sql + "   )   ";
            cmd.CommandText = Tmp_Sql;
            string countSql = " SELECT COUNT(*) as total FROM (" + Tmp_Sql + ")";
            //匯出時 ,取全部資料, par_paging =true            
            DataSet ds = getDataTable(cmd, countSql, par_paging);

            //將[工時] 轉換成小數2位
            int Tmp_Cnt = ds.Tables["T1"].Rows.Count;
            double Tmp_HOUR_OT = 0;
            double Tmp_HOUR_WORK = 0;
            ds.Tables["T1"].Columns.Add(new DataColumn("HOUR_WORK_", typeof(string)));
            ds.Tables["T1"].Columns.Add(new DataColumn("HOUR_OT_", typeof(string)));
            for (int i = 0; i < Tmp_Cnt; i++)
            {
                //施工人數/施工工時/施工步序                
                DataRow dr = ds.Tables["T1"].Rows[i];
                Tmp_HOUR_WORK = double.Parse(dr["HOUR_WORK"].ToString());
                Tmp_HOUR_OT = double.Parse(dr["HOUR_OT"].ToString());
                dr["HOUR_WORK_"] = Tmp_HOUR_WORK.ToString("0.00");
                dr["HOUR_OT_"] = Tmp_HOUR_OT.ToString("0.00");
            }  // end of  for (int i=0

            return ds;
        }




2023年2月16日 星期四

V120102 – Master[存檔]完成, 自動重新顯示 - Ext.getCmp('btn_Show').fireHandler(); - 新增模式

 目的: V120102 – Master[存檔]完成, 自動重新顯示

處理說明:  1>[存檔].onClick ,會先執行 [Template].[存檔].onClick , 再執行本畫面.[存檔].onClick

                   2>Ext.getCmp('btn_Show').fireHandler();  //重新顯示 Master資料


1>*.js  --> 只有目前在[新增]模式, 才重新顯示資料

var is_add=false;

Ext.getCmp('btn_add').on("click", function () {
 setFieldsCls('myform', ['TPCODE', 'DCODE', 'CODENOTE',], ['BITM', 'TPCODE_', 'MKER', 'MKER_', 'MKDT']);
        is_add = true;
    }
    );



//設定 [存檔]鈕, 會先執行 parent 的 onclick 再執行本程式 onclick -->重新開啟 datastore
Ext.getCmp('btn_save').on('click', function () {
       console.log(" 0 btn_save onclick - V120103.onclick");
       if ((is_add==true)) { //若為[新增]模式, 才重新顯示資料
           Ext.getCmp('btn_Show').fireHandler();
         }
         is_add = false;
});

Ext.getCmp('btn_cancel').on('click', function () {
is_add = false;
});

2>*.cs

[HttpPost]
        public void Insert()
        {
            var c = System.Web.HttpContext.Current;
            NameValueCollection nvc = c.Request.Form;
            //excuteInsert(nvc, DBTable);
            NameValueCollection nvc1 = new NameValueCollection();
            foreach (string k in nvc.Keys)
            {
                nvc1[k] = nvc[k];
            }            
               int Tmp_MAXITM = int.Parse(GET_MAX_BITM());
               nvc1["BITM"] = (Tmp_MAXITM + 1).ToString();
                nvc1["MKER"] = LoginUserModel.LoginUserId;
                nvc1["MKDT"] = DateTime.Now.ToString("yyyy/MM/dd");
            excuteInsert(nvc1, DBTable);
        }

        [HttpPost]
        public void Update()
        {
            var c = System.Web.HttpContext.Current;
            NameValueCollection nvc = c.Request.Form;
            NameValueCollection nvc1 = new NameValueCollection();
            foreach (string k in nvc.Keys)
            {
                nvc1[k] = nvc[k];
            }
            nvc1["MKER"] = LoginUserModel.LoginUserId;
            nvc1["MKDT"] = DateTime.Now.ToString("yyyy/MM/dd");
            string[] arrCondition = getPK();            
            excuteUpdate(nvc1, DBTable, arrCondition);
        }

V120102 - 判斷輸入欄位值是否含中文字

 目的: V120102 - 判斷輸入欄位值是否含中文字

處理說明:  1>中文字的內碼  0x4E00~0x9FBB
                   2>檢核每一字元的內碼是否在中文字範圍內 (0x4E00-0x9FBB)


1>*.cs  -判斷字串是否含中文字的函式 
    1>>myfunc.cs  - ContainChinese(string input)  
          - 若含中文字,則傳回 true, 否則 傳回 false
        public static bool ContainChinese(string input)
        {
            string pattern = "[\u4e00-\u9fbb]";
            return Regex.IsMatch(input, pattern);
        }

   2>>V120102APIController.cs
         //[條碼編碼]不可為中文字                            
          if (myfunc.ContainChinese(Tmp_DCODE))
             {
                 Tmp_RtnMsg1 = Tmp_RtnMsg1 + "[條碼編碼]不可含中文字;";
             }                            

2>*.js  V120102.js  -按[存檔]鈕, 判斷字串是否含中文字的函式 
      Ext.getCmp('btn_save').checkFormValue = function () {
        //1>檢核 [條碼編號(DCODE)] 不可含中文字
        console.log(" Ext.getCmp('btn_save').checkFormValue : ");
        var Tmp_Str = Ext.getCmp("DCODE").getValue();
        console.log(" DCODE : ", Tmp_Str);
        for (var i = 0; i < Tmp_Str.length; i++) {
            console.log("char i : ", i);
            if (Tmp_Str.charCodeAt(i) >= 0x4E00 & Tmp_Str.charCodeAt(i) <= 0x9FA5) {
                Tmp_Str = "[條碼編碼("+Tmp_Str+")]不可含中文字,請重新輸入"
                mywarnalert(Tmp_Str);                
                return false;
            }
        }





PS:
/* unicode 判斷是否為中文字
中文:/^[\u4E00-\u9FA5]+$/
數字:/^d+$/(是非負整數哦)
字母:/^[a-zA-Z]{1,30}$/(1到30個以字母串)
*/

2023年2月15日 星期三

ILIAS2SAP_目前F16V進料_工單領料_處理說明

 目的:ILIAS2SAP_目前F16V進料_工單領料_處理說明












2023年2月14日 星期二

GitLab -認可@推送的目的- (目前修改中的Source(V120102)中,但臨時要上版另一支Source(V120502-原本已上版但再次修改)

目的: 1>GitLab目前分支(A)修改中Source(V120102) , 

          2>但使用者測試正式區 V120502 有問題,
               (經修改V120502後 , 要如何只上版 V120502 (不含修改中的 Source V120102)



處理說明: 1>修改完成目前SourceA,並認可 --> 存入本機分支 A(Source A+B)

                  2>提取master,只修改SourceB(分支B) --> 認可+推送 --> merge 至遠端 GitLab master

                      --> 不可以  master 推送

                  3>繼續的原本程式(分支A: Source A+B)


1>修改完成目前SourceA,並認可 --> 存入分支 A(Source A+B)
     --> 認可, 只儲入本機的GitLab儲存庫





2>提取master,只修改SourceB(分支B) --> 認可+推送 --> merge 至遠端 GitLab master

  詳如另一篇 Blogger: 
GitLab 操作說明(如何同步遠端 master 回來)

3>繼續的程式(分支A: Source A+B)




2023年2月7日 星期二

V120202B : css - div margin border 的用法 - table cellsapcing - cellpadding border 的用法

 目的: V120202B css - div  margin  border 的用法   - table   cellsapcing - cellpadding border 的用法

           HTML online : https://www.tutorialspoint.com/online_html_editor.php

處理說明: 1> 設定標籤的長寬 & 標籤的列印位置往右移 & 設定邊線寬度
                       <div id='print_area' style='width:10cm;height:4cm;margin:0px 0px 0px 20px;
                         border:5px solid green;'>

                  2>設定  table 的 邊線間距(cellspacing) , 邊框2文字間距(cellpadding=0)
<table id='my_tbl1' style='width:100%; margin:0px 0px 0px 10px;' border=1px borderstyle='solid' bordercolor='blue' cellspacing=0 cellpadding=0>
 
                 3>  <table> row底線
<td width=35% style='border-bottom:1px solid black;'>機號:"+Tmp_ASN+"</td>
<td width=35% style='border-bottom:1px solid black;' >工號: "+Tmp_SAPNO+"</td>

                         

1>範例1 : <div> marin padding


*.html
<div id='print_area' style='width:10cm;height:4cm;border:5px solid green;
margin:0px 0px 0px 20px;padding:0px 0px 0px 10px;'>
<div id='my_div_1' style='width: 9.8cm; height: 3.5cm;border: 1px solid brown;font-size:0.5pt;'>
<table id='my_tbl1' style='width:100%; margin:0px 0px 0px 10px;' border=1px borderstyle='solid' bordercolor='blue' cellspacing=0>
<tr>
<td width=35%>機號: A049 </td>
<td width=35% '>工號: 12345678</td>
<td width=35% '>工單件號: SROPN_1 </td>
</tr>
</table>


2>範例2 : <table> margin cellspacing cellpadding
*.html
<table id='my_tbl1' style='width:100%;margin:0px 0px 0px 10px;' cellpadding=6 border=1px borderstyle='solid' bordercolor='blue' cellspacing=2>

<tr>
<td width=35%>機號: A049 </td>
<td width=35% '>工號: 12345678</td>
<td width=35% '>工單件號: SROPN_1 </td>
</tr>
</table>


3> <table> row底線


<div id='print_area' style='width:10cm;height:4cm;border:5px solid green; margin:2px 5px 1px 15px;'>
<div id='my_div_1' style='width: 9.8cm; height: 3.5cm;border: 1px solid yellow;font-size:4pt; margin:2px 5px 1px 15px; '>
<table id='my_tbl1' style='width:100%;padding:0 0 0 10;' border=0px borderstyle='solid' bordercolor='blue' cellspacing=0>
<tr style="border-bottom:1px solid blue">
<td width=35% style='border-bottom:1px solid black;'>機號: A049 </td>
<td width=35% style='border-bottom:1px solid black;'>工號: 12345678</td>
<td width=35% style='border-bottom:1px solid black;'>工單件號: SROPN_1 </td>
</tr> </table>






Sample:


Source:   

<!DOCTYPE html>
<html>
<head>
<style>
div {
  background-color: lightgrey;
  width: 300px;
  height: 200px;
  border: 15px solid green;
  padding: 50px;
  margin: 20px;
}
</style>
</head>
<body>

<h2>Demonstrating the Box Model</h2>

<p>The CSS box model is essentially a box that wraps around every HTML element. It consists of: borders, padding, margins, and the actual content.</p>

<div>This text is the content of the box. We have added a 50px padding, 20px margin and a 15px green border. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>

</body>
</html>