Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Setting column widths in excel using html

Posted by: Jimjongil Aug 15 2020, 05:02 AM

First post, so i hope i've posted it in the right place!

I'm currently building tables in excel and exporting as CSV to upload to a website. When uploaded the columns are fitting the data inside of the table rather than carrying over the excel formatting. I need to be able to adjust column sizes so that they will carry over when uploaded onto the webpage.

Any help would be greatly appreciated.

James

Posted by: pandy Aug 15 2020, 05:33 AM

Don't follow. Have you already got the data into a HTML table?

Anyhow, make whatever you use to convert the data from CSV to a HTML table to also add the desired widths to the cells in the top row. Could be TD or TH, doesn't matter.
https://htmlhelp.com/reference/html40/tables/td.html

Alternatively add IDs to those cells and set the width with CSS.

Posted by: Jimjongil Aug 15 2020, 08:55 AM

No I haven't yet converted the table into HTML, will give it a try and let you know how i get on.

Thanks for the help

Posted by: Darin McGrew Aug 15 2020, 10:01 AM

QUOTE(Jimjongil @ Aug 15 2020, 02:02 AM) *
I'm currently building tables in excel and exporting as CSV to upload to a website. When uploaded the columns are fitting the data inside of the table rather than carrying over the excel formatting.
I don't think CSV supports formatting in any way. It's just data, row by row by row, with column values separated by commas.

Posted by: pandy Aug 15 2020, 10:14 AM

Surely a server side language must be able to transform that to a HTML table? If it doesn't need to happen on the server it can basically be done with Find & Replace.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)