File: table_helpers.ex

package info (click to toggle)
elixir-earmark-parser 1.4.44-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,148 kB
  • sloc: makefile: 9
file content (25 lines) | stat: -rw-r--r-- 486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
defmodule Support.TableHelpers do
  import EarmarkAstDsl

  @moduledoc ~S"""
  Extends AstDsl for tables
  """

  def tbody(cells) do
    tag("tbody", tag("tr", cells))
  end

  def thead(cells) do
    tag("thead", tag("tr", cells))
  end

  def td(content, align \\ "left") do
    tag("td", [content], style: "text-align: #{align};")
  end

  def th(content, align \\ "left") do
    tag("th", [content], style: "text-align: #{align};")
  end
end

# SPDX-License-Identifier: Apache-2.0