jQuery DataTable中的复杂标题

时间:2015-08-10 08:23:41

标签: jquery datatables

如何在jQuery DataTable中创建类似此标题的内容?

enter image description here

1 个答案:

答案 0 :(得分:3)

是的,请参阅标签(主要是html标签):https://www.datatables.net/examples/basic_init/complex_header.html

适用于您的案例,http://jsfiddle.net/t4tzwm6c/ (这真的只是html rowspan和colspan的问题)

段:

var txt2send = '<div class="generate_div_last">
            <h3>Sentences:</h3>
            <form id="sent" name="sent" method="post" action="http://www.ipsum-generator.com/loremipsum/sentences">
                <input type="text" id="numsent" name="num" size="2" maxlength="3" value="50" />
                <input type="submit" id="poslji3" class="poslji" name="poslji" value="Generate!" />
                <h4>Options:</h4>
                <input type="checkbox" id="p_tags_sent" name="p_tags" />
                    <span class="tiny2">
                        <label for="p_tags_sent">Add paragraph tags (&lt;p&gt;)</label>
                    </span><br />
                <input type="checkbox" id="i_tags_sent" name="i_tags" />
                    <span class="tiny2">
                        <label for="i_tags_sent">Add <i>italic</i> tags (&lt;i&gt;)</label>
                    </span><br />
                <input type="checkbox" id="b_tags_sent" name="b_tags" />
                    <span class="tiny2">
                        <label for="b_tags_sent">Add <b>bold</b> tags (&lt;b&gt;)</label>
                    </span><br />
            </form>
            <div class="small">This option will generate the specified number of sentences of lorem ipsum.</div>
        </div>';