2012-10-25 124 views
0

任何人都可以幫助我瞭解如何實現此輸出。如果可能。垂直和水平表格標題

我想查看我的頭水平和垂直。

e.g

 Header 4 Header 5 Header 6 Calendar 
Header 1 a  b  c  10/10 
Header 2 d  e  f  11/10 
Header 3 g  h  i  12/10 

垂直頭被硬編碼,但水平頭應該從數據庫(其由用戶輸入的)被上傳,我想在柱的端部要顯示的日曆。這意味着如果讓用戶確實輸入了5個輸入並且它顯示在水平標題中並且日曆應該顯示在第7列上。

這裏是我的html

{% if solutions%} 
<div id ="person_table"> 
<form action="{% url Solution_view person_NOID %}" method="post"> 
{% csrf_token %} 
<table border="1" id="thetable"> 
<thead> 
     <tr> 
     <th>NOID {{ person_NOID }}</th> 
     <th>SMOKING</th> 
     <th>WEIGHT</th> 
     <th>BP</th> 
     </tr> 
</thead> 
<tbody> 
{% for solution in solutions %} 

<tr> 
    <td>{{ solution.NEW_DATE }}</td> 
    <td><input type="text" name="solution" id="solution{{ forloop.counter }}" value="{{ solution.SMOKING}}" /></td> 
    <td><input type="text" name="solution" id="solution{{ forloop.counter }}" value="{{ solution.WEIGHT}}" /></td> 
    <td><input type="text" name="solution" id="solution{{ forloop.counter }}" value="{{ solution.BP}}" /></td> 
    <td><input type="text" name="solution" id="solution{{ forloop.counter }}" value="{{ solution.BP}}" /></td> 
</tr> 
{% endfor %}     
</tbody> 
</table> 
<input type="submit" value="Save" /> 
</form> 
{% else %} 
<p>No Data.</p> 
{% endif %} 
</body> 

我不知道這是可以做到。看來,我不能涉及到this SO。

+1

是的,這是可能的。下一個問題? – deed02392

+0

謝謝,你能給我至少在哪裏得到的信息..我有點卡住了。 – noobes

回答

0

您可以隨時使用自定義模板來隨意顯示數據。如果你需要一個現有的插件與分頁,排序等功能,我會推薦jqgrid

+0

謝謝@konstant我會檢查它。將在我得到解決方案時更新。 – noobes

+0

哇... @康斯坦特。非常感謝你......那就是我正在尋找.... – noobes

+0

很高興它幫助! – Konstant

0

有很多jquery插件,你可以去,我自己已經使用數據表和jquery powertable我自己。以下是網站和最後一個鏈接是一個例子

1. Datatables:可能是我遇到的最強大的jQuery表插件。

2. jQuery Powertable:jquery中着名的日期時間選擇器的作者。

3. JQ Grid:還沒有測試過自己,但看起來很穩固。

4.關於powertable的示例鏈接

+0

謝謝@sayannayas – noobes