Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active July 27, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/ae13fa556a90ec350d8b2c5450452edb to your computer and use it in GitHub Desktop.
Save bjoerntx/ae13fa556a90ec350d8b2c5450452edb to your computer and use it in GitHub Desktop.
@using TXTextControl.Web.MVC
@{
var sDocument = "<html><body><p>Welcome to <strong>Text Control</strong></p></body></html>";
}
@Html.TXTextControl().TextControl(settings => {
settings.UserNames = new string[] { "Tim Typer" };
}).LoadText(sDocument, TXTextControl.Web.StringStreamType.HTMLFormat).Render()
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment