⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tableedit.aspx.cs

📁 内容管理 内容管理 内容管理 内容管理 内容管理
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AjaxPro;

namespace MyDemo.Table
{
    public partial class TableEdit_Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(TableEdit_Default));
        }

        #region 自有编辑器

        [AjaxPro.AjaxMethod]

        public HtmlTable GenerateTable(int rowCount, int colCount, string width, string height, string color)
        {

            HtmlTable table = new HtmlTable();
            table.CellSpacing = 1;
            table.CellPadding = 3;
            table.Border = 2;
            table.BorderColor = "black";
            table.BgColor = "skyblue";
            table.Width = width + "%";
            table.Height = height + "%";
            table.BgColor = color;

            for (int i = 0; i < rowCount; i++)
            {
                HtmlTableRow row = new HtmlTableRow();
                for (int j = 0; j < colCount; j++)
                {
                    HtmlTableCell cell = new HtmlTableCell();
                    cell.InnerText = "row " + i + ", col " + j;
                    row.Cells.Add(cell);
                }

                table.Rows.Add(row);
            }

            return table;
        }
        public HtmlTable ChangeBackColor(HtmlTable table, string color)
        {
            table.BgColor = color;
            return table;

        }

        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -