I work on a python(django) project. I write csv code as follows,
response = HttpResponse(mimetype='text/csv')
response['Content-Disposition'] = 'attachment; filename=DueDateWiseSearch.csv'
writer = csv.writer(response)
writer.writerow(['Infant Name','Mother Name','Mother Address',
'Next Vaccine Dose','Due date','Coments'])
this row is the header and I need to bold all header text. I download csv as ms "Excel" file.
How can I do it? Please help!
There's no way to do that in CSV. You could all caps the output, or you could use another format that supports text styles. Show activity on this post. CSV only contains data, it doesn't contain any formatting information.
There is no way to add formatting to CSV file. It can only ever be text.
CSV only contains data, it doesn't contain any formatting information. If you need to format your data, I'd suggest actually creating an XLS file instead of a CSV file. Try using something like xlwt.
There's no way to do that in CSV. You could all caps the output, or you could use another format that supports text styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With