Adjust table output HTML for wicket DataTable

Source: Internet
Author: User

Method 1:

Inherit the defaultdatatable and provide your own HTML template.

Method 2:

Inherit defaultdatatable, add Attributemodifier to the constructor so that no HTML template is provided and the template automatically inherits from defaultdatatable.html

About Odd,even. That is, the table provides a zebra effect that can be replicated defaultdatatable Newrowitem method:

@Overrideprotected item<t> Newrowitem (final String ID, final int index, final imodel<t> model) {return new Odde Venitem<t> (ID, index, model);} Contents of Oddevenitem: @Overrideprotected void Oncomponenttag (Componenttag tag) {Super.oncomponenttag (tag); Tag.put (" Class ", (GetIndex ()% 2 = = 0)? class_even:class_odd);}

You can create a new class that inherits from Oddevenitem, a replication oncomponenttag, such as for a purecss table:

@Overrideprotected void Oncomponenttag (Componenttag tag) {Super.oncomponenttag (tag); if (GetIndex ()% 2! = 0) { Tag.put ("Class", "pure-table-odd");}}


Adjust table output HTML for wicket DataTable

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.