Skip to content

Instantly share code, notes, and snippets.

@hemache
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save hemache/11299520 to your computer and use it in GitHub Desktop.

Select an option

Save hemache/11299520 to your computer and use it in GitHub Desktop.
<html>
<head></head>
<body>
<table border="1">
<tr>
<th>Colonne date</th>
<th>Autre colonne</th>
</tr>
<tr>
<td><span class="date"></span></td>
<td>bla bla bla bla</td>
</tr>
<tr>
<td><span class="date"></span></td>
<td>blo blo blo blo</td>
</tr>
<tr>
<td><span class="date"></span></td>
<td>bli bli bli bli</td>
</tr>
</table>
<script>
(function(){
var colonnesDate = document.getElementsByClassName("date"),
date = new Date(),
dateAujourdhui = date.toDateString(); // http://www.w3schools.com/jsref/jsref_obj_date.asp
for(var x=0; x <= colonnesDate.length; x++)
{
colonnesDate[x].innerText = dateAujourdhui;
}
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment