我正在PhoneGap 的帮助下制作一个Android 应用程序。请帮助我如何动态地带来背景颜色
在 HTML5 中:-
<div data-role="page">
    <div data-role="content" >
        <div class="my_body1">      
            <ul id="table_list_id"></ul>
        </div>
    </div>
</div>
在 CSS3 中:-
.my_body1 ul li {
    float: left;
    list-style-type: none;
    border: 2px solid #a1a1a1;
    padding: 5px 5px;
    text-align: center;
    width: 120px;
    border-radius: 5px;
    margin: 1%;
    box-shadow: 5px 5px 5px #888888;
}
.my_body1 ul {
    width: 100%;
}
.my_body1 ul li a {
    text-decoration: none;
    color: #525252;
}
在 jQuery 中:-
  function callXMLConnection() {
    $("#table_list_id").empty();
    $.support.cors = true;
    $.ajax({
        type: "GET",
        url: "table.html",
        contentType: "text/xml",
        dataType: "xml",
        data: "",
        cache: false,
        processData: false,
        crossDomain: true,
        success: function (data) {
            $(data).find('xyz').each(function () {
                var title = $(this).find('title').text();
                var status = $(this).find('status').text();
                if (status == 'vacant') {
                    var scripts = "<li><a href='#'>" + title + "</a></li>"
                    $("#table_list_id").append(scripts).trigger('create');
                }
                else if (status == 'occupied') {
                    var scripts = "<li><a href='#' >" + title + "</a></li>"
                    $("#table_list_id").append(scripts).trigger('create');
                }
            });
        }
    });
}
$(document).unbind('pageinit').bind('pageinit', function () {
    callXMLConnection();
});
我想要状态为空时的背景颜色,那么它应该是绿色,而当状态被占用时,它应该是红色。
请帮帮我