스타일 적용

This commit is contained in:
2025-06-27 14:53:15 +09:00
parent cc2a90545a
commit 1802e52736

View File

@ -37,9 +37,9 @@ def get_precipitation_summary():
try:
data = response.json()
total_rainfall = 0.0
lines = [f'<h3 style="font-size:2em; text-align:center;">[시간대별 강수량]</h3>']
lines.append(f'<table style="min-width:400px; border: 1px #333 solid; text-align:center; ">')
lines.append(f'<tr><th>시간</th><th>강수량</th></tr>')
lines = [f'<div style="text-align:center;"><h3 style="font-size:2em; text-align:center; margin: 20px 0;">[시간대별 강수량]</h3>']
lines.append(f'<table style="min-width:400px; text-align:center; ">')
lines.append(f'<tr><th style="border: 1px #333 solid; ">시간</th><th style="border: 1px #333 solid; ">강수량</th></tr>')
for item in data['response']['body']['items']['item']:
if item['category'] == 'PCP' and item['fcstDate'] == TODAY:
@ -47,11 +47,11 @@ def get_precipitation_summary():
if 900 < int(time) < 2300:
mm = parse_precip(item['fcstValue'])
time_str = f"{time[:2]}:{time[2:]}" # '11:00'
lines.append(f"<tr><td>{time_str}</td><td>{mm}mm</td></tr>")
lines.append(f'<tr><td style="border: 1px #333 solid; ">{time_str}</td><td style="border: 1px #333 solid; ">{mm}mm</td></tr>')
total_rainfall += mm
lines.append("</table>")
lines.append("</table></div>")
lines.append(f"<p>영업시간 중 총 예상 강수량: <strong>{total_rainfall:.1f}mm</strong></p>")
return ''.join(lines)