HTML表格生成器 [英] HTML Table Generator

查看:92
本文介绍了HTML表格生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将文本表文件转换为HTML表文件

Translates text table files into HTML table files

Text Table File Format
[
  title: title_of_the_table;
  heading: heading_1, heading_2, ..., heading_n;
  row: value_1, value_2, ..., value_n;
  row: value_1, value_2, ..., value_n;
  ... ... ...
  border: (yes | no); // default: no
  csum: (yes | no); // default: no
  rsum: (yes | no); // default: no
]
[
  ... // another table
]
...



每个表以"["开头,以]结尾
•每个语句均以特定的关键字开头,并以;"结尾 •语句没有顺序,即它们可以混合在一起
•行"声明是必不可少的(至少需要租用1),其他则是可选的
•关键字不区分大小写
•文本文件可能包含无限数量的表
•一张桌子可以在一行中嵌入另一个桌子(请参阅下一张幻灯片)




文本表代码



Each table begins with "[" and ends with "]"
•Each statement begins with a specific keyword and ends with ";"
•Statements have no order, i.e., they can be intermixed
•"row" statement is essential (at lease 1 required) but others are optional
•Keywords are not case sensitive
•A text file may contain unlimited number of tables
•A table can embed another table within a row (refer to the next slide)




text table code

[
title: Example table A;
heading: heading_1, heading_2, heading_3;
row: value_11, value_21, value_31;
row: value_12, value_22, value_32;
]



转换为html表(输出)



translate to html table(output)

<table>
<caption>Example table A</caption>
<tr>
<th>heading_1</th><th>heading_2</th><th>heading_3</th>           
</tr>
<tr>
<td>value_11</td><td>value_21</td><td>value_31</td>
</tr>
<tr>
<td>value_12</td><td>value_22</td><td>value_32</td>
</tr>
<table>




如果文本表代码带有''border:是''

输出表应带有边框


基本要求
•必须符合OOP的基本原则
–封装,继承,多态,重载,...
•HTML表元素必须作为一个类实现,并且必须形成继承层次结构
–制作具有通用数据和方法的根类元素"
•例如,数据成员"children","value",…
•例如,多态方法"serialize"调用子对象的"serialize"
–通过从类"Element"继承来使每个表元素类
•例如"Table","Caption","Tr","Th","Td",…
类 •其他
–处理所有预期的异常
–详细地为每个类,方法,对象,函数和变量写注释




if text table code has a '' border:yes ''

output table should have a border


Basic Requirements
•Must conform basic principles of OOP
–Encapsulation, inheritance, polymorphism, overloading, …
•HTML table elements must be implemented as a class and must form a inheritance hierarchy
–Make the root class "Element" that has common data and methods
•E.g., data member "children", "value", …
•E.g., polymorphic method "serialize" that calls "serialize" of child objects
–Make each table element class by inheriting from class "Element"
•E.g., class "Table", "Caption", "Tr", "Th", "Td", …
•Others
–Handle all expected exceptions
–Write comments for each class, method, object, function, and variable in detail

推荐答案

如果要发布作业,至少要尝试使其看起来像就像您尝试自己做某事一样!

我们不做您的作业:这是有原因的.在这里,您可以考虑自己被告知的内容,并尝试理解它.也可以在那里帮助您的导师识别您的弱点,并将更多的注意力放在补救措施上.

自己尝试,或学习魔语:您要用它炸薯条吗?"
If you are going to post your homework, at least try to make it look like you have attempted to do something yourself!

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, or learn the Magic Words: "Do you want fries with that?"


这篇关于HTML表格生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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