textarea 内表格的 CSS 样式 [英] CSS styling for table inside textarea

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

问题描述

我正在从数据库中检索数据并以表格格式将其显示在 textarea 中,我尝试对 textarea 中的表格应用 CSS 样式但没有效果,有没有人知道或以前做过这个,请指教,我正在使用 Javascript编辑器显示更像 word 以便用户可以格式化文档,

I'm retrieving data from database and display it inside textarea in table format, I try to apply CSS styling for table inside textarea but no effect, does any one know or done this before, please advise, I'm using Javascript editor to the display more like word so user can format the document,

<style type="text/css"> 
 table {  } 
 td,th { white-space:nowrap; padding:3px;color: red; } 
 .test { 
 font-family: Arial, Helvetica, sans-serif;
 font-size: 16px;
 color: red; }
 </style>

 <table width="120%" border="0" cellpadding="0" cellspacing="1">
  <tr>
   <td width=100% valign="top" class="test">Test
    <textarea name="txt_letter_body" style="width=100%" rows="50" >         <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr valign=top>
       <td  class="test">Data</td>
       <td align=left colspan=3><font face="Arial, Helvetica, sans-serif" size=3  ></font></td>
      </tr>
      <tr valign=top>
       <td></td>
       <td colspan=3><hr noshade size=1 color=#000000></td>
      </tr>
     </table>
    </textarea> 
   </td>
  </tr>
 </table>

是否可以将 css 应用于 textarea 内的表格.

Is it any possible to apply css for table inside textarea.

推荐答案

最后我找到了 1 个解决方案,我只是在 textarea 之后将样式属性添加到表格中,如下图

finally i found 1 solution, i just add style attributes into table after textarea, which as below

<table width="100%" border="0" style="font-family: arial;">

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

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