1

I have created a table dynamically using JQuery. But I cant able to apply css for the created table column. Here the sample link in codepen codepen.

I want set width:100px for 1st column. Plese help me in this. Thanks in advance...

SiVi
  • 177
  • 1
  • 14

3 Answers3

3

actually you can modify the way that you are defining the width of the columns, like:

td.time-cell{
  width: 100px;
  min-width: 100px;
}
td.drop{
  width: 100%;
}

in this way you can ensure that the first column is only 100px and the other one will expand.

http://codepen.io/anon/pen/vEboLP

jfplataroti
  • 661
  • 4
  • 12
2

Remove #patientApptTable width:100%;

#patientApptTable {
  border-spacing: 0;
  width:100%; // remove this line
  border-collapse:collapse;
}

Also, it is not valid to insert <div> into <tr>.

Community
  • 1
  • 1
Danijel
  • 12,408
  • 5
  • 38
  • 54
0

set the width of the column heading instead

#patientApptTable th:first-child{
    width: 100px !important;
}

http://codepen.io/anon/pen/bNzXeE

Omer Bokhari
  • 57,458
  • 12
  • 44
  • 58