Plsql 如何循环和打印按钮类
我目前打印出表格单元格中的部分列表,因此将显示为链接。 以下是代码:Plsql 如何循环和打印按钮类,plsql,Plsql,我目前打印出表格单元格中的部分列表,因此将显示为链接。 以下是代码: ..... FOR i in 1 .. l_loop_count LOOP -- Print end of row every 3 cells IF (i > 1) and (mod(i,3) = 1) THEN print_out('"</tr><tr>" +'); END IF; -- Print a blank cell if out of sections IF i > g_sec
.....
FOR i in 1 .. l_loop_count LOOP
-- Print end of row every 3 cells
IF (i > 1) and (mod(i,3) = 1) THEN
print_out('"</tr><tr>" +');
END IF;
-- Print a blank cell if out of sections
IF i > g_sections.count THEN
print_out('"<td></td>" +');
.....
我想做的是将链接替换为按钮。因此,所有节名称都位于按钮内部,而不是链接。
所以我想我需要改变下面的代码行,用按钮CSS打印出一个按钮,但不起作用
print_out('"</tr><tr>" +');
到
在输出中,我仍然可以看到带有链接的行/单元格,现在可以看到上面没有文本的按钮
我的整个代码太大,无法发布,所以希望小标题能帮助解释我所拥有的
谢谢。现在,您正在每个表格行之间插入空按钮。如果我没弄错的话,你想插入按钮而不是链接 因此,您需要将class=bt添加到您的标记中,使其看起来像这样:假设您使用的是Twitter引导或其他为标记提供btn类的css 你能分享插入标签的相关代码吗 编辑: 试着替换 具有 端环; -结束这张桌子 打印出“+”; 打印出“;”; -结束
打印出来 此问题是否与Oracle Application Express相关?如果是,您可以使用它的工具生成HTML代码。感谢josepp的回答。这是我的带有标记的代码。您是否尝试替换@AMRobert?我已更新我的答案以匹配您更详细的代码
print_out('"</tr><button class=\"btn\"></button><tr>" +');
…
-- Print Section name
print_out('"<td><a href=\"javascript:;\" OnClick=\"displaySection(''TOC'',''' || to_char(i) || ''')\">' ||
g_sections(i).name || '</a> " +');
…
…
-- Print Section name
print_out('"<td><a class=\"btn\" href=\"javascript:;\" OnClick=\"displaySection(''TOC'',''' || to_char(i) || ''')\">' ||
g_sections(i).name || '</a> " +');
…
BEGIN
-- Script tag, assign old content to var, reassign old content and new stuff
print_out('
<script type="text/javascript">
var auxs;
auxs = document.getElementById("toccontent").innerHTML;
document.getElementById("toccontent").innerHTML = auxs +
"<table width=\"100%\"><tr>" +');
-- Dont want less than 3 table cells per row so force to loop in multiples of 3
IF mod(g_sections.count,3) = 0 THEN
l_loop_count := g_sections.count;
ELSE
l_loop_count := g_sections.count + 3 - mod(g_sections.count,3);
END IF;
-- Loop through sections and generate HTML
FOR i in 1 .. l_loop_count LOOP
-- Print end of row every 3 cells
IF (i > 1) and (mod(i,3) = 1) THEN
-- print_out('"</tr><tr>" +');
print_out('"</tr><button class=\"btn\"></button><tr>" +');
END IF;
-- Print a blank cell if out of sections
IF i > g_sections.count THEN
print_out('"<td></td>" +');
ELSE
-- Add to counts
l_cnt_err := l_cnt_err + g_sections(i).error_count;
l_cnt_warn := l_cnt_warn + g_sections(i).warn_count;
l_cnt_succ := l_cnt_succ + g_sections(i).success_count;
-- Print Section name
print_out('"<td><a href=\"javascript:;\" OnClick=\"displaySection(''TOC'',''' || to_char(i) || ''')\">' ||
g_sections(i).name || '</a> " +');
-- Print if section in error or warning
IF g_sections(i).result ='E' THEN
print_out('"<img class=\"error_ico\">" +');
l_action_req := true;
ELSIF g_sections(i).result ='W' THEN
print_out('"<img class=\"warn_ico\">" +');
l_action_req := true;
END IF;
-- Print end of cell
print_out('"</td>" +');
END IF;