create an automatic bold for table by the ID ?? with javascript

first of all I apologize for my bad English, I want to make a JavaScript for a tabele who makes himself automatically by the ID Bold, just like this one here but the code is not only for weeks for tabele
the table has therefore different time input I will when the time is for example 08:00 clock, the tabele from 08:15 to mark Irish always +1

<td id="1">08:00</td>
<td id="1">BEKA-KAQANIK</td>
</tr>
<tr>
<td id="2">08:15</td>
<td id="2">MEDINA</td>

Here is an example but it is only on weekdays

Read More

http://jsfiddle.net/c5bHx/

var days = 'sunday,monday,tuesday,wednesday,thursday,friday,saturday'.split(',');

document.getElementById( days[(new Date()).getDay()] ).className = 'bold';
.bold {
    font-weight:bold;
}
<div id="monday">Monday: 12:00-2:00</div>
<div id="tuesday">Tuesday: 11:00-3:00</div>
<div id="wednesday">wednesday: 12:00-2:00</div>
<div id="thursday">thursday: 11:00-3:00</div>
<div id="friday">friday: 12:00-2:00</div>
<div id="saturday">saturday: 11:00-3:00</div>
<div id="sunday">sunday: 12:00-2:00</div>

Related posts

1 comment

  1. I’m not sure if I understand your question correctly, but here is an example JSFIDDLE. It might help with what you’re trying to accomplish.

    <table>
        <tr id="1530">
            <td>15:30</td>
            <td>A</td>
        </tr>
        <tr id="1545">
            <td>15:45</td>
            <td>B</td>
        </tr>
        <tr id="1600">
            <td>16:00</td>
            <td>C</td>
        </tr>
    </table>
    
    // Initialize new Date object.
    var currentDate = new Date();
    
    // Get the hour
    var currentHour = currentDate.getHours();
    
    // Get the minutes 
    var currentMinute = currentDate.getMinutes();
    
    // Bin the minutes to 15 minute increments by using modulus
    // For example, xx:33 becomes 30
    var minuteBin = currentMinute - (currentMinute % 15);
    
    // Create a string that matches the HTML ids
    var idString = "" + currentHour + minuteBin;
    
    // Set the matching div class to 'bold' 
    document.getElementById(idString).className = 'bold';
    
    // Log variables to console for debugging
    console.log("Time =",currentHour,":",currentMinute,"bin =",minuteBin,"idString =",idString);
    

    This example is meant for GMT-0400 (EDT). This will give different results in different time zones.

    If I’ve misunderstood anything, please let me know and I will do my best to update my answer. Hope that helps!

Comments are closed.