0

I want to build a table with header containing Months and dates without weekends on the top as the following:

enter image description here.

Using HTML or JavaScript. Anyone please help me on this

gherkins
  • 14,603
  • 6
  • 44
  • 70
Neer
  • 1,627
  • 3
  • 13
  • 8

1 Answers1

0

I would be creating a table using JavaScript. You could cycle through the dates that you wish to display. Run the check that is detailed in the answer on this SO question. It will check to determine if the date is a weekend or note. Code from question:

var day = yourDateObject.getDay();
var isWeekend = (day == 6) || (day == 0);    // 6 = Saturday, 0 = Sunday

Using that as the validating statement in your loop, you can then just call document.createElement('th') to create your header. It's pretty simple from there.

Community
  • 1
  • 1
JosephGarrone
  • 4,081
  • 3
  • 38
  • 61