Skip to content

Instantly share code, notes, and snippets.

@numbnet
Created February 25, 2021 11:50
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 numbnet/bd037d55afe7e3d8a7af88ece110a8b8 to your computer and use it in GitHub Desktop.
Save numbnet/bd037d55afe7e3d8a7af88ece110a8b8 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Название документа</title>
</head>
<style>tr > td:nth-child(1) {background-color: #f00;}tr>td:nth-child(2) {background-color: #0006ff;}</style>
<body>
<button onclick="foo()">Создать абзац</button>
<script>
function foo() {
var elem = document.createElement("tr");
elem.innerHTML = "<td>1 БЛОК 1.</td><td>2 БЛОК 2</td>";
document.body.appendChild(elem);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment