Calender
Im trying to create a calendar using Python/Django.
So far I got this: https://i.imgur.com/FfnXiUG.png
This is with the calendar library from Python.
This generates a bunch of html:
<table border="0" cellpadding="0" cellspacing="0" class="month"> <tr><th colspan="7" class="month">March 2020</th></tr> <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="sun">1</td></tr> <tr><td class="mon">2</td><td class="tue">3</td><td class="wed">4</td><td class="thu">5</td><td class="fri">6</td><td class="sat">7</td><td class="sun">8</td></tr> <tr><td class="mon">9</td><td class="tue">10</td><td class="wed">11</td><td class="thu">12</td><td class="fri">13</td><td class="sat">14</td><td class="sun">15</td></tr> <tr><td class="mon">16</td><td class="tue">17</td><td class="wed">18</td><td class="thu">19</td><td class="fri">20</td><td class="sat">21</td><td class="sun">22</td></tr> <tr><td class="mon">23</td><td class="tue">24</td><td class="wed">25</td><td class="thu">26</td><td class="fri">27</td><td class="sat">28</td><td class="sun">29</td></tr> <tr><td class="mon">30</td><td class="tue">31</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> </table>
My question is that it seems to be hard to style this, im able to style some elements of it but borders and such seems hard. Also, is it possible to edit this part:
<table border="0" cellpadding="0" cellspacing="0" class="month">
Would it be smarter not to use the .calendarHTML and generate it more on my own? It seems I can use td or tr for styling, but im unable to get borders and make it look nice.
0 Replies