Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<meta charset="utf-8">
<title>Название документа</title>
<style>tr > td:nth-child(1) {background-color: #f00;}tr>td:nth-child(2) {background-color: #0006ff;}</style>
<button onclick="foo()">Создать абзац</button>
function foo() {
var elem = document.createElement("tr");
elem.innerHTML = "<td>1 БЛОК 1.</td><td>2 БЛОК 2</td>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment