I want to put a series of dates (mainly month, day, year) displayed in a vertical system of table cells On the first page of the web page, the current date needs to be zero one day, in order to be present date with the next date, the remaining dates are required to grow in the future in the future for 16 days in the future.
Does anyone help me find out how? I have seen a javascript and are unable to get that date in a cell to comprehend and understand a date (addition or subdivision) and it is also found that the HTML table has many other dates mentioned above How to be displayed
Try it out:
HTML
& Lt; Table id = "myTable" & gt; & Lt; / Table & gt;
javascript
var table = document.getElementById ('myTable') var myDate = new date (); For MyDate.setDate (myDate.getDate () - 1) (var i = 0; i & lt; 16; i ++) {var row = document.createElement ('TR'); Var cell = document.createElement ('TD'); Cell.innerText = myDate.getDate () + "/" + (myDate.getMonth () + 1) + "/" + myDate.getYear (); MyDate.setDate (myDate.getDate () + 1) row.appendChild (cell); Table.tBodies [0] .appendChild (line); }
Comments
Post a Comment