<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Styled Table</title>
  <style>
    body {
      font-family: 'Georgia', serif;
      padding: 2rem;
      background-color: #fff;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      border-spacing: 0;
      font-size: 16px;
    }

    caption {
      caption-side: top;
      font-weight: bold;
      text-align: left;
      background-color: #eaf3fb;
      padding: 0.75rem 1rem;
      font-size: 18px;
    }

    caption span {
      color: #007acc;
    }

    th, td {
      padding: 10px 15px;
      text-align: left;
      vertical-align: top;
      border-bottom: 1px solid #ccc;
    }

    th {
      font-weight: bold;
      border-bottom: 3px solid #007acc;
    }

    tr:last-child td {
      border-bottom: 3px solid #007acc;
    }

    td em {
      font-style: italic;
    }

    .table-caption {
      background-color: #eaf6ff; /* light blue background */
      border-top: 2px solid #00aaff; /* top border */
      padding: 10px;
      font-family: 'Georgia', serif;
      font-size: 18px;
    }

    .table-caption .label {
      color: #00aaff;
      font-weight: bold;
    }

    .table-caption .caption {
      font-weight: bold;
    }

    .note {
        font-size: 16px;
        padding: 10px;
    }
  </style>
</head>
<body>
    <div class="table-caption">
        <span class="label">Table 1</span>
        <span class="caption">Characteristics of study participants.</span>
    </div>
    <table class="table table-bordered table-condensed table-hover">
<colgroup>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th><b>Variables</b></th>
<th colspan="5" style="text-align:center;"><b>Sleep latency (min)</b></th>
</tr>
<tr>
<th></th>
<th>&lt;10 (<i>n</i> = 339)</th>
<th>10–19 (<i>n</i> = 437)</th>
<th>20–29 (<i>n</i> = 230)</th>
<th>≥30 (<i>n</i> = 390)</th>
<th>
<i>P</i> value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Suboptimal SRH, <i>n</i> (%)</td>
<td>106 (31.3)</td>
<td>176 (40.3)</td>
<td>109 (47.4)</td>
<td>208 (53.3)</td>
<td data-jats-char="." style="text-align:char;">&lt;0.001</td>
</tr>
<tr>
<td>Gender (female), <i>n</i> (%)</td>
<td>186 (54.9)</td>
<td>247 (56.5)</td>
<td>141 (61.3)</td>
<td>244 (62.6)</td>
<td>0.114</td>
</tr>
<tr>
<td>Grade, <i>n</i> (%)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Freshman</td>
<td>41 (12.1)</td>
<td>60 (13.7)</td>
<td>22 (9.6)</td>
<td>26 (6.7)</td>
<td>0.044</td>
</tr>
<tr>
<td style="padding-left:1pc;">Sophomore</td>
<td>152 (44.8)</td>
<td>192 (43.9)</td>
<td>116 (50.4)</td>
<td>173 (44.4)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Junior</td>
<td>93 (27.4)</td>
<td>129 (29.5)</td>
<td>60 (26.1)</td>
<td>123 (31.5)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Senior and above</td>
<td>53 (15.6)</td>
<td>56 (12.8)</td>
<td>32 (13.9)</td>
<td>68 (17.4)</td>
<td></td>
</tr>
<tr>
<td>Residence, <i>n</i> (%)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>0.518</td>
</tr>
<tr>
<td style="padding-left:1pc;">City</td>
<td>125 (37.1)</td>
<td>169 (38.8)</td>
<td>93 (40.4)</td>
<td>143 (36.7)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Town</td>
<td>73 (21.7)</td>
<td>101 (23.2)</td>
<td>49 (21.3)</td>
<td>73 (18.7)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Countryside</td>
<td>139 (41.2)</td>
<td>166 (38.1)</td>
<td>88 (38.3)</td>
<td>174 (44.6)</td>
<td></td>
</tr>
<tr>
<td>Single child (yes), <i>n</i> (%)</td>
<td>167 (49.3)</td>
<td>200 (45.8)</td>
<td>106 (46.1)</td>
<td>181 (46.4)</td>
<td>0.781</td>
</tr>
<tr>
<td>Parental education, <i>n</i> (%)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>&lt;0.001</td>
</tr>
<tr>
<td style="padding-left:1pc;">Primary school and below</td>
<td>25 (7.4)</td>
<td>38 (8.7)</td>
<td>17 (7.4)</td>
<td>34 (8.7)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Junior high school</td>
<td>126 (37.2)</td>
<td>169 (38.7)</td>
<td>82 (35.7)</td>
<td>142 (36.4)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">High school or Technical School</td>
<td>102 (30.1)</td>
<td>128 (29.3)</td>
<td>81 (35.2)</td>
<td>124 (31.8)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Bachelor and above</td>
<td>86 (25.4)</td>
<td>102 (23.3)</td>
<td>50 (21.7)</td>
<td>90 (23.1)</td>
<td></td>
</tr>
<tr>
<td>Body mass index, kg/m<sup>2</sup>
</td>
<td>20.9 (2.9)</td>
<td>20.5 (2.8)</td>
<td>21.0 (2.8)</td>
<td>20.7 (2.8)</td>
<td>0.208</td>
</tr>
<tr>
<td>Afternoon nap(yes), <i>n</i> (%)</td>
<td>259 (76.4)</td>
<td>340 (77.8)</td>
<td>182 (79.1)</td>
<td>290 (74.4)</td>
<td>0.518</td>
</tr>
<tr>
<td>Midnight snack habit (yes), <i>n</i> (%)</td>
<td>63 (18.0)</td>
<td>84 (19.2)</td>
<td>20 (8.7)</td>
<td>62 (15.9)</td>
<td>0.004</td>
</tr>
<tr>
<td>Sleep duration, <i>n</i> (%)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>&lt;0.001</td>
</tr>
<tr>
<td style="padding-left:1pc;">≤6 h</td>
<td>57 (16.8)</td>
<td>68 (15.6)</td>
<td>46 (20.0)</td>
<td>98 (25.1)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">7 h</td>
<td>161 (47.5)</td>
<td>230 (52.6)</td>
<td>134 (58.3)</td>
<td>202 (51.8)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">≥8 h</td>
<td>121 (35.7)</td>
<td>139 (31.8)</td>
<td>50 (21.7)</td>
<td>90 (23.1)</td>
<td></td>
</tr>
<tr>
<td>Chronotype, <i>n</i> (%)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>0.003</td>
</tr>
<tr>
<td style="padding-left:1pc;">Morning-type</td>
<td>105 (31.0)</td>
<td>122 (27.9)</td>
<td>63 (27.4)</td>
<td>83 (21.3)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Intermediate-type</td>
<td>95 (28.0)</td>
<td>142 (32.5)</td>
<td>74 (32.2)</td>
<td>103 (26.4)</td>
<td></td>
</tr>
<tr>
<td style="padding-left:1pc;">Evening-type</td>
<td>139 (41.0)</td>
<td>173 (39.6)</td>
<td>93 (40.4)</td>
<td>204 (52.3)</td>
<td></td>
</tr>
<tr>
<td>Sitting time, h/d</td>
<td>8.0 (6.0,10.0)</td>
<td>8.0 (6.0,10.0)</td>
<td>8.0 (6.0,10.0)</td>
<td>8.0 (5.0,10.0)</td>
<td>0.196</td>
</tr>
<tr>
<td>Physical activity, h/d</td>
<td>1.0 (0.5,2.0)</td>
<td>1.0 (0.5,2.0)</td>
<td>1.0 (0.5,2.0)</td>
<td>1.0 (0.5,1.5)</td>
<td>0.276</td>
</tr>
</tbody>
</table>
    <div class="note">
        Notes: Values are mean (SD) or median ( P 25 , P 75 ) for continuous variables and frequency (percentage) for categorical variables.
    </div>
</body>
</html>