Update app.py
Browse files
app.py
CHANGED
@@ -126,22 +126,11 @@ def generate_html_tables(data, selected_fields):
|
|
126 |
|
127 |
table_style = (
|
128 |
"width: 100%;"
|
129 |
-
"table-layout: fixed;"
|
130 |
-
# "border-collapse: collapse;"
|
131 |
-
# "word-wrap: break-word;"
|
132 |
"height: 100%;"
|
|
|
133 |
)
|
134 |
|
135 |
-
|
136 |
-
# "height: 30px;"
|
137 |
-
"padding: 8px;"
|
138 |
-
"border: 1px solid #ccc;"
|
139 |
-
"vertical-align: top;"
|
140 |
-
"text-align: left;"
|
141 |
-
"overflow: hidden;"
|
142 |
-
)
|
143 |
-
|
144 |
-
th_td_style_other = (
|
145 |
"padding: 8px;"
|
146 |
"border: 1px solid #ccc;"
|
147 |
"vertical-align: top;"
|
@@ -154,12 +143,12 @@ def generate_html_tables(data, selected_fields):
|
|
154 |
if section_fields:
|
155 |
table_html = f"<h3 style='margin-bottom: 0.5em;'>{section}</h3>"
|
156 |
table_html += f"<table style='{table_style}'>"
|
157 |
-
table_html += f"<tr><th style='{
|
158 |
for label in section_fields:
|
159 |
key = label_key_map[label]
|
160 |
value = data.get(key, "N/A")
|
161 |
details = "<i>Not Available</i>" if value == "N/A" else format_bullets(value)
|
162 |
-
table_html += f"<tr><td style='{
|
163 |
table_html += "</table>"
|
164 |
html_tables.append(table_html)
|
165 |
|
@@ -173,7 +162,7 @@ def generate_html_tables(data, selected_fields):
|
|
173 |
)
|
174 |
for table in row_tables:
|
175 |
grouped_html += (
|
176 |
-
"<div style='
|
177 |
f"{table}"
|
178 |
"</div>"
|
179 |
)
|
|
|
126 |
|
127 |
table_style = (
|
128 |
"width: 100%;"
|
|
|
|
|
|
|
129 |
"height: 100%;"
|
130 |
+
"table-layout: fixed;"
|
131 |
)
|
132 |
|
133 |
+
th_td_style = (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
"padding: 8px;"
|
135 |
"border: 1px solid #ccc;"
|
136 |
"vertical-align: top;"
|
|
|
143 |
if section_fields:
|
144 |
table_html = f"<h3 style='margin-bottom: 0.5em;'>{section}</h3>"
|
145 |
table_html += f"<table style='{table_style}'>"
|
146 |
+
table_html += f"<tr><th style='{th_td_style}; width: 150px;'>Field</th><th style='{th_td_style};'>Details</th></tr>"
|
147 |
for label in section_fields:
|
148 |
key = label_key_map[label]
|
149 |
value = data.get(key, "N/A")
|
150 |
details = "<i>Not Available</i>" if value == "N/A" else format_bullets(value)
|
151 |
+
table_html += f"<tr><td style='{th_td_style}; width: 150px;'><b>{label}</b></td><td style='{th_td_style}'>{details}</td></tr>"
|
152 |
table_html += "</table>"
|
153 |
html_tables.append(table_html)
|
154 |
|
|
|
162 |
)
|
163 |
for table in row_tables:
|
164 |
grouped_html += (
|
165 |
+
"<div style='display: flex; flex-direction: column;'>"
|
166 |
f"{table}"
|
167 |
"</div>"
|
168 |
)
|