|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Insert Table</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="JavaScript" type="text/javascript"> <!-- function AddTable() { var widthType = (document.tableForm.widthType.value == "pixels") ? "" : "%"; var html = '<table border="' + document.tableForm.border.value + '" cellpadding="' + document.tableForm.padding.value + '" '; html += 'cellspacing="' + document.tableForm.spacing.value + '" width="' + document.tableForm.width.value + widthType + '">\n'; for (var rows = 0; rows < document.tableForm.rows.value; rows++) { html += "<tr>\n"; for (cols = 0; cols < document.tableForm.columns.value; cols++) { html += "<td> </td>\n"; } html+= "</tr>\n"; } html += "</table>\n"; window.opener.insertHTML(html); window.close(); } //--> </script> </head> <body style="margin: 10px; background: #D3D3D3;"> <form name="tableForm"> <table cellpadding="4" cellspacing="0" border="0"> <tr> <td align="right">Rows:</td> <td><input name="rows" type="text" id="rows" value="2" size="4"></td> <td align="left">Columns: <input name="columns" type="text" id="columns" value="2" size="4"></td> </tr> <tr> <td align="right">Table width:</td> <td><input name="width" type="text" id="width" value="100" size="4"></td> <td align="left"> <select name="widthType" id="widthType"> <option value="pixels">pixels</option> <option value="percent" selected>percent</option> </select> </td> </tr> <tr> <td align="right">Border thickness:</td> <td><input name="border" type="text" id="border" value="1" size="4"></td> <td align="left">pixels</td> </tr> <tr> <td align="right">Cell padding:</td> <td><input name="padding" type="text" id="padding" value="4" size="4"></td> <td>Cell spacing: <input name="spacing" type="text" id="0" value="0" size="4"></td> </tr> <tr> <td colspan="3" align="center"> <input type="button" value="Insert Table" onClick="AddTable();" /> <input type="button" value="Cancel" onClick="window.close();" /> </td> </tr> </table> </form> </body> </html> |