首先,我为我糟糕的英语道歉,我想为一个tabele做一个JavaScript,这个tabele会自动使用ID粗体,就像这里的这个一样,但是代码不仅仅是tabele的几个星期
因此,该表有不同的时间输入,例如08:00时钟,tabele从08:15开始标记为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>

这是一个例子,但只是在工作日
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>

最佳答案

我不确定我是否正确理解了你的问题,但这里有一个例子JSFIDDLE。它可能会帮助你完成你想完成的事情。

<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);

此示例适用于GMT-0400(EDT)。这将在不同的时区产生不同的结果。
如果我误解了什么,请告诉我,我会尽力更新我的答案。希望能有帮助!

09-20 15:34