如何导出Excel电子表格到HTML表与INLINE CSS? [英] How to export Excel spreadsheet to HTML table with INLINE CSS?

查看:216
本文介绍了如何导出Excel电子表格到HTML表与INLINE CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何将我的电子表格中的表格转换为html格式,而不使用所有的微软特定代码。我们的网页托管在其他地方,这意味着我无法访问我们网页的< head> 部分。我们只能在< body> 中插入内容。我只希望表格保留相同的字体,边框和格式,任何和所有的CSS样式直接包含在表代码中,而不是其他地方。



/ strong>



它实际上似乎工作,如果我把CSS类在< body> 文件。这是合法吗?我认为这些应该被定义在< head>

 < body> 
< style type =text / css>
table.mytable {
border:1px solid #CCC; font-family:Verdana,Verdana,Geneva,sans-serif
font-size:12px;
}

EDIT: b

我发现在Excel中复制并粘贴到Dreamweaver中的实时视图比在电子表格中创建更清晰的html而不是html。你还是剩下一个bajillion的CSS类,你必须编辑出来,但它至少是更接近一步。



如果你得到一个错误消息,同时粘贴一个大表在Dream Weaver中查看此页



FINAL EDIT:



在将表导出到任何html编辑器之前,表格中的单元格与格式画家。使用此工具确保绘制每个类似格式的单元格的格式。这样,你不会得到一个百万不同的CSS类的单元格应该有一个特定的格式。它会让你的生活变得很容易,特别是如果你的桌子是大和详细的。

解决方案

将风格代码放置在身体上不是非法,但是不太友好



头文件中常用的是指向.css文件的指针



我建议你转换你的xls dreamweaver,然后使用Sublime文本编辑器编辑html结果此处


I'd like to know how to get the table in my spreadsheet into html format without all the microsoft specific code. Our webpage is hosted elsewhere which means I don't have access to the <head> part of our pages. We can only insert content into the <body>. I just want the table to retain the same fonts, borders and formatting with any and all CSS styling included directly in the table code not elsewhere.

EDIT:

It actually appears to work if I put the CSS classes in the <body> of my document. Is that legal? I thought those were supposed to be defined in the <head>???

<body>
<style type="text/css">
table.mytable {
border: 1px solid #CCC; font-family: Verdana, Verdana, Geneva, sans-serif
font-size: 12px;
} 

EDIT:

I have found that copying in Excel and pasting into the Live View in Dreamweaver creates much cleaner html than saving as html in your spreadsheet. You are still left with a bajillion CSS classes that you have to edit out but it's at least it's a step closer.

If you get an error message whilst pasting a large table in Dream Weaver see this page.

FINAL EDIT:

Before you export your table to any html editor go through ALL of the cells in your table with the format painter. Using this tool make sure you paint the format of every similarly formatted cell. That way you won't get a million different CSS classes for cells that should have a particular format. It will make your life a hell of a lot easier particularly if your table is large and detailed.

解决方案

It is not "illegal" to place the style codes on the body, but defenitly not web friendly

What usualy goes in the head is a pointer to a .css file

I recomend you convert your xls(x) file with dreamweaver and then edit the html result with Sublime Text Editor Available here

这篇关于如何导出Excel电子表格到HTML表与INLINE CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆