如何在文本框或文本区域中获得类似表格的格式?

时间:2023-01-14 16:28:25

I'm using TinyMCE textareas or textboxes for an event logger app, and I need the text to be formatted a certain way. Something like this:

我正在使用TinyMCE textareas或文本框作为事件记录器应用程序,我需要以某种方式格式化文本。像这样的东西:

如何在文本框或文本区域中获得类似表格的格式?

I can't figure out how to do this without a table, which I cannot nest in the textarea or textbox. Any suggestions?

我不知道如何在没有表格的情况下做到这一点,我无法在textarea或文本框中嵌套。有什么建议?

3 个解决方案

#1


You cannot -layout- content in a textbox or textarea. You want to either go for TinyMCE as an iframe (where layout is broken relatively easy), or create separate inputfields for dates and logs (and layout using html/css).

您不能在文本框或文本区域中包含内容。您希望将TinyMCE作为iframe(布局相对容易打破),或者为日期和日志创建单独的输入字段(以及使用html / css进行布局)。

#2


TinyMCE has a table plugin that you can use. Have you tried that?

TinyMCE有一个可以使用的表插件。你试过吗?

Search for "tinymce table plugin". Your example seems to be a 3x2 table.

搜索“tinymce table plugin”。您的示例似乎是一个3x2表。

#3


You may also want to look into the TinyMCE template plugin.

您可能还想查看TinyMCE模板插件。

Like Jeff Yang mentioned, you can use tables to help your users lay out their content without CSS (it makes me cringe, but yes on CMS-driven sites with users of all types editing content, I still give them a table to save me headaches).

就像Je​​ff Yang提到的那样,你可以使用表来帮助你的用户在没有CSS的情况下布局他们的内容(这让我很畏缩,但是在CMS驱动的网站上是的,所有类型的用户都在编辑内容,我仍然给他们一张表来节省我的头痛)。

The template plugin will allow you to set up your own table, lock it in place, and then let the users select it from a dropdown. So, you could set up a table to your specifications above, name it "2-column with dates" or something, and train your users to select that when they needed it.

模板插件允许您设置自己的表,将其锁定到位,然后让用户从下拉列表中选择它。因此,您可以根据上面的规范设置一个表,将其命名为“带有日期的2列”或其他内容,并训练用户在需要时选择它。

The plugin also has a preview option so your users can pick and choose exactly which template they need.

该插件还有一个预览选项,因此您的用户可以精确挑选他们需要的模板。

#1


You cannot -layout- content in a textbox or textarea. You want to either go for TinyMCE as an iframe (where layout is broken relatively easy), or create separate inputfields for dates and logs (and layout using html/css).

您不能在文本框或文本区域中包含内容。您希望将TinyMCE作为iframe(布局相对容易打破),或者为日期和日志创建单独的输入字段(以及使用html / css进行布局)。

#2


TinyMCE has a table plugin that you can use. Have you tried that?

TinyMCE有一个可以使用的表插件。你试过吗?

Search for "tinymce table plugin". Your example seems to be a 3x2 table.

搜索“tinymce table plugin”。您的示例似乎是一个3x2表。

#3


You may also want to look into the TinyMCE template plugin.

您可能还想查看TinyMCE模板插件。

Like Jeff Yang mentioned, you can use tables to help your users lay out their content without CSS (it makes me cringe, but yes on CMS-driven sites with users of all types editing content, I still give them a table to save me headaches).

就像Je​​ff Yang提到的那样,你可以使用表来帮助你的用户在没有CSS的情况下布局他们的内容(这让我很畏缩,但是在CMS驱动的网站上是的,所有类型的用户都在编辑内容,我仍然给他们一张表来节省我的头痛)。

The template plugin will allow you to set up your own table, lock it in place, and then let the users select it from a dropdown. So, you could set up a table to your specifications above, name it "2-column with dates" or something, and train your users to select that when they needed it.

模板插件允许您设置自己的表,将其锁定到位,然后让用户从下拉列表中选择它。因此,您可以根据上面的规范设置一个表,将其命名为“带有日期的2列”或其他内容,并训练用户在需要时选择它。

The plugin also has a preview option so your users can pick and choose exactly which template they need.

该插件还有一个预览选项,因此您的用户可以精确挑选他们需要的模板。