我想通過html表格和中心顯示圖像。如何實現這一目標? 這個圖像不過是一個進度條。所以這個圖像會在加載時出現在html表格上。我嘗試像下面這樣,但它不是通過html表和中心的表。如何將圖像置於html表中
<div style="overflow: auto;height: 400px">
<table id ="tbl" style="width: 100%;background-image: url(img/busyIndicator.gif);background-repeat: no-repeat;background-position: center" >
<colgroup>
<col style="width: 30px"/>
<col style="width: 10px"/>
<col style="width: 1px" />
<col style="width: 80px"/>
<col/>
</colgroup>
<script id="Template" type="text/x-jquery-tmpl">
<tr >
<td>${Id}</td>
<td>${Age}</td>
<td></td>
<td>${Name}</td>
</tr>
</script>
<tbody id="List">
</tbody>
</table>
</div>
希望它澄清我的問題。讓我知道你是否需要更多信息。
UPDATE1
現在我已經加入圖像上表,而不是TD,但仍然沒有顯示出來
UPDATE2 我通過Ajax調用數據加載到我的jQuery模板。不知道是否需要顯示我的代碼的Ajax調用。因此圖像會出現數據被加載時,它應該熄滅時,其成品裝載
你所需要的進度條在桌子加載時出現在桌子的頂部,在加載結束後消失完成了嗎?您可能需要使用JavaScript。 你是說圖像沒有加載或僅在桌子中央加載? –
把圖像放在一個div中,然後將它懸浮在表格頂部 – prospector
@HarikrishnanT你說得很對。這個怎麼做? – Happy