You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

<!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>&nbsp;</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>