Packages
diint_utilites_common_app
1.0.1
1.4.23
1.4.22
1.4.21
1.4.20
1.4.19
1.4.18
1.4.17
1.4.16
1.4.15
1.4.14
1.4.12
1.4.11
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.9
1.3.8
1.3.7
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.101
1.2.11
1.2.10
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
библиотеки для работы с ребитом и протоколы
Current section
Files
Jump to
Current section
Files
src/utilites/html_render.erl
%%%-------------------------------------------------------------------
%%% @author cheese
%%% @copyright (C) 2016, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 06. Jul 2016 1:43 PM
%%%-------------------------------------------------------------------
-module(html_render).
-author("cheese").
%% API
-export([render/1]).
%% API
-export([pr_render/2]).
render(Arr) ->
pr_render(Arr, <<>>).
pr_render([], Res) ->
Res;
pr_render([Head | Tail], Res) ->
Tag = case Head of
html_s ->
<<"<html>">>;
html_e ->
<<"</html>">>;
body_s ->
<<"<body>">>;
body_e ->
<<"<body>">>;
table_s ->
<<"<table style='border: 1px solid darkgray;background-color:#d0e9c6;opacity: 0.9;line-height:20px;padding:2px; width: 600px'>">>;
table_e ->
<<"</table">>;
th_s ->
<<"<tr style='background-color: darkseagreen;border: 1px solid black;font-weight:normal;padding:3px;height: 30px;'>">>;
th_e ->
<<"</tr>">>;
tr_s ->
<<"<tr>">>;
tr_e ->
<<"</tr>">>;
td_s ->
<<"<td>">>;
td_2_s ->
<<"<td colspan='2' style='text-align:center;'>">>;
td_e ->
<<"</td>">>;
row_break_2 ->
<<"<tr><td colspan='2' style='background-color:darkseagreen;padding:3px;line-height:1px;'> </td></tr>">>;
_ ->
Head
end,
pr_render(Tail, <<Res/binary, Tag/binary>>).