Description & Source Code

The XHTML component set is a collection of components, each XHTML component stand for an HTML tag. The most important thing is that you can control it by server side API. it is possible to declare different namespaces within one ZUL file and use the tags belonging to each namespace liberally.
In this example, the XHTML table tag is used to construct a table which contains a ZK listbox component.
All XHTML components are under org.zkoss.zhtml package. (Javadoc :
More details in ZK Developer's Reference - The XHTML Component Set

<zk xmlns:x="xhtml" xmlns:zk="zk">
        Sample <b><font color="#008BB6">Shopping Cart</font></b> Table in Plain HTML
    <x:table border="2">
                <listbox id="list" mold="select">
                    <listitem selected="true" label="----" />
                    <listitem label="Coke" />
                    <listitem label="Sprite" />
                    <listitem label="Fanta" />
                <!-- Invoke server side event listener -->
                <x:input type="button" value="Add Item" zk:onClick="addItem()" />
                <x:ul id="ul">
                    <x:li>Nestle Coffee</x:li>
                    <x:li>Evian Water</x:li>
        import org.zkoss.zhtml.Li;
        import org.zkoss.zhtml.Text;
        void addItem() {
            if ("----".equals(list.getSelectedItem().getLabel())) {
                alert("Please select one item.");
            Li li = new Li();
            new Text(list.getSelectedItem() == null ? "Null" :
                    list.getSelectedItem().getLabel() ).setParent(li);