Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active July 27, 2022 09:46
Show Gist options
  • Save bjoerntx/3cca05b476eeca17bd191a11cf7863ef to your computer and use it in GitHub Desktop.
Save bjoerntx/3cca05b476eeca17bd191a11cf7863ef to your computer and use it in GitHub Desktop.
<%@ Register Assembly="TXTextControl.Web" Namespace="TXTextControl.Web" TagPrefix="cc1" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<cc1:TextControl ID="TextControl1" runat="server" />
<input type="button" onclick="insertTable()" value="Insert Table" />
<script>
function insertTable() {
TXTextControl.tables.add(5, 5, 10, function(e) {
if (e === true) { // if added
TXTextControl.tables.getItem(function(table) {
table.cells.forEach(function(cell) {
cell.setText("Cell text");
});
}, null, 10);
}
})
}
</script>
</asp:Content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment