当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTableRow类代码示例

本文整理汇总了C#中HtmlTableRow的典型用法代码示例。如果您正苦于以下问题:C# HtmlTableRow类的具体用法?C# HtmlTableRow怎么用?C# HtmlTableRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HtmlTableRow类属于命名空间,在下文中一共展示了HtmlTableRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTableRow

    private static void CreateTableRow(HtmlTable table, Post post)
    {
        HtmlTableRow row = new HtmlTableRow();

        HtmlTableCell date = new HtmlTableCell();
        date.InnerHtml = post.DateCreated.ToString("yyyy-MM-dd");
        date.Attributes.Add("class", "date");
        row.Cells.Add(date);

        HtmlTableCell title = new HtmlTableCell();
        title.InnerHtml = string.Format("<a href=\"{0}\">{1}</a>", post.RelativeLink, post.Title);
        title.Attributes.Add("class", "title");
        row.Cells.Add(title);

        if (BlogSettings.Instance.IsCommentsEnabled)
        {
            HtmlTableCell comments = new HtmlTableCell();
            comments.InnerHtml = post.ApprovedComments.Count.ToString();
            comments.Attributes.Add("class", "comments");
            row.Cells.Add(comments);
        }

        if (BlogSettings.Instance.EnableRating)
        {
            HtmlTableCell rating = new HtmlTableCell();
            rating.InnerHtml = post.Raters == 0 ? "None" : Math.Round(post.Rating, 1).ToString();
            rating.Attributes.Add("class", "rating");
            row.Cells.Add(rating);
        }

        table.Rows.Add(row);
    }
开发者ID:bpanjavan,项目名称:Blog,代码行数:32,代码来源:archive.aspx.cs

示例2: ShowCampaignTable

    /// <summary>
    /// select the table to show from the db and build the table in the page
    /// </summary>
    protected void ShowCampaignTable()
    {
        Campaign cam = new Campaign();
        List<Campaign> campaigns = cam.GetCampaignList(email);

        foreach (Campaign c in campaigns)
        {
            HtmlTableRow tr = new HtmlTableRow();
            HtmlTableCell tc = new HtmlTableCell();
            HtmlTableCell tc1 = new HtmlTableCell();
            HtmlTableCell tc2 = new HtmlTableCell();
            HtmlTableCell tc3 = new HtmlTableCell();
            HtmlTableCell tc4 = new HtmlTableCell();
            HtmlTableCell tc5 = new HtmlTableCell();
            tc.InnerHtml = c.Name;
            tc1.InnerHtml = c.DateCreated.ToString();
            tc2.InnerHtml = c.Id.ToString();
            tc3.InnerHtml = c.Voucher;
            tc4.InnerHtml = c.ShareCount.ToString();
            if (c.IsActive == true)
                tc5.InnerHtml = "פעיל";
            else
                tc5.InnerHtml = "לא פעיל";
            tr.Cells.Add(tc);
            tr.Cells.Add(tc1);
            tr.Cells.Add(tc2);
            tr.Cells.Add(tc3);
            tr.Cells.Add(tc4);
            tr.Cells.Add(tc5);
            campaignsData.Controls.Add(tr);

        }
    }
开发者ID:kerenmishael,项目名称:BusinessRealityFinalProject,代码行数:36,代码来源:Campaign.aspx.cs

示例3: ContHTML

 public void ContHTML()
 {
     for (int i = 0; i < ContListName.Count; i ++ )
     {
         name[i] = ContListName[i] + "<span onclick=ContDelId('" + ContListIdType[i] + "')>" + "</span>";
         img[i] = "<input type=image onserverclick=Del_ServerClick src=\\ICBCDynamicSite\\site\\Fund\\Bmp\\FundCompare\\button_delete_off.gif />";
         ShowAlert(name[i]);
         ShowAlert(img[i]);
     }
     HtmlTable table = new HtmlTable();
     table.Border = 0;
     table.CellPadding = 0;
     for (int rowcount = 0; rowcount < name.Length; rowcount ++ )
     {
         HtmlTableRow row = new HtmlTableRow();
         HtmlTableCell cell1 = new HtmlTableCell();
         HtmlTableCell cell2 = new HtmlTableCell();
         cell1.ColSpan = 2;
         cell1.Align = "Left";
         cell2.Align = "Right";
         cell1.Controls.Add(new LiteralControl(name[rowcount]));
         cell2.Controls.Add(new LiteralControl(name[rowcount]));
         row.Cells.Add(cell1);
         row.Cells.Add(cell2);
         table.Rows.Add(row);
     }
     Place.Controls.Clear();
     Place.Controls.Add(table);
 }
开发者ID:PhilTheAir,项目名称:Aspnet,代码行数:29,代码来源:Default.aspx.cs

示例4: CreateRow

 private HtmlTableRow CreateRow(JobInfo item)
 {
     HtmlTableRow row = new HtmlTableRow();
     row.Cells.Add(CreateCell(item.NameKey));
     row.Cells.Add(CreateCell(item.DataValue));
     return row;
 }
开发者ID:TCarmack,项目名称:Brentwood,代码行数:7,代码来源:OrderCompletePage.aspx.cs

示例5: AddItem

 private void AddItem(string prtName, string val) {
     var tr = new HtmlTableRow();
     var td=new HtmlTableCell();
     int rc=tbprt.Rows.Count;
     if (rc > 0)//如果存在行
     {
         if (tbprt.Rows[rc - 1].Cells.Count == 4)//如果最后行已满
         {
             
             tbprt.Rows.Add(tr);//直接添加一个新行
         }
         else
         {
             tr = tbprt.Rows[rc - 1];//将tr设为最后的行
         }
     }
     else {//如果还没有行
         tbprt.Rows.Add(tr);
     }
     td.InnerText = prtName;
     td.Attributes["class"] = "fieldHead";
     tr.Cells.Add(td);
     td = new HtmlTableCell();
     td.InnerText = val;
     tr.Cells.Add(td);
     
 }
开发者ID:uwitec,项目名称:ds568,代码行数:27,代码来源:Property.ascx.cs

示例6: LayoutColumns

  private void LayoutColumns()
  {
    HtmlTableRow tr = new HtmlTableRow();
    tr.Attributes["class"] = "ReportLayout";
    tblReport.Rows.Add(tr);

    HtmlTableCell td = new HtmlTableCell();
    tr.Cells.Add(td);
    td.Width = "20px";
    td.Height = "0px";

    td = new HtmlTableCell();
    tr.Cells.Add(td);
    td.Width = "120px";
    td.Height = "0px";

    td = new HtmlTableCell();
    tr.Cells.Add(td);
    td.Width = "120px";
    td.Height = "0px";

    td = new HtmlTableCell();
    tr.Cells.Add(td);
    td.Width = "50px";
    td.Height = "0px";

    td = new HtmlTableCell();
    tr.Cells.Add(td);
    td.Width = "500px";
    td.Height = "0px";
  }
开发者ID:ClaireBrill,项目名称:GPV,代码行数:31,代码来源:ShowDeactivated.aspx.cs

示例7: RenderAccounts

    public string RenderAccounts(TransitAccount[] accounts)
    {
        HtmlTable table = new HtmlTable();
        table.Border = 0;
        table.BorderColor = "White";
        HtmlTableRow row = new HtmlTableRow();
        table.Rows.Add(row);
        foreach (TransitAccount ta in accounts)
        {
            HtmlTableCell cell = new HtmlTableCell();
            cell.Controls.Add(new LiteralControl(string.Format(
                "<div><a href='AccountView.aspx?id={0}'>" +
                "<img border=0 style='width: 50%;' src='AccountPictureThumbnail.aspx?id={1}'></a></div>" +
                "<div class=sncore_link><a href='AccountView.aspx?id={0}'>{2}</a>", ta.Id, ta.PictureId, Render(ta.Name))));
            row.Cells.Add(cell);
            if (row.Cells.Count % 4 == 0)
            {
                row = new HtmlTableRow();
                table.Rows.Add(row);
            }
        }

        StringBuilder sb = new StringBuilder();
        StringWriter sw = new StringWriter(sb);
        table.RenderControl(new HtmlTextWriter(sw));
        return sb.ToString();
    }
开发者ID:dblock,项目名称:sncore,代码行数:27,代码来源:PlaceFriendsQueueView.aspx.cs

示例8: AddRowIconClassName

 protected void AddRowIconClassName(string icon, HtmlTable table, HtmlTableRow row)
 {
     HtmlTableCell cell1 = new HtmlTableCell();
     cell1.InnerHtml = icon;
     row.Cells.Add(cell1);
     table.Rows.Add(row);
 }
开发者ID:mohamedwaelkaizen,项目名称:ajax-docs,代码行数:7,代码来源:DefaultCS.aspx.cs

示例9: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     //首先创建一个HtmlTable对象
     HtmlTable table1 = new HtmlTable();
     //设置HtmlTable的格式属性
     table1.Border = 1;
     table1.CellPadding = 1;
     table1.CellSpacing = 1;
     table1.BorderColor = "red";
     //下面的代码向HtmlTable添加内容
     HtmlTableRow row;
     HtmlTableCell cell;
     for (int i = 1; i <= 5; i++)
     {
         // 创建一个新的行,并设置其背景色属性
         row = new HtmlTableRow();
         row.BgColor = (i % 2 == 0 ? "lightyellow" : "lightcyan");
         for (int j = 1; j <= 4; j++)
         {
             //创建一个新的列,为其设置文本
             cell = new HtmlTableCell();
             cell.InnerHtml = "行: " + i.ToString() +
             "<br />列: " + j.ToString();
             //添加列对象到当前的行
             row.Cells.Add(cell);
         }
         //添加行对象到当前的Htmltable
         table1.Rows.Add(row);
     }
     //添加HtmlTable到当前页的控件集合中
     this.Controls.Add(table1);
 }
开发者ID:AJLoveChina,项目名称:workAtQmm,代码行数:32,代码来源:Default.aspx.cs

示例10: OnInit

    protected override void OnInit(EventArgs e)
    {
        string filename = Server.MapPath("settings.xml");
        XPathDocument document = new XPathDocument(filename);
        XPathNavigator navigator = document.CreateNavigator();
        XPathExpression expression = navigator.Compile("/appSettings/*");
        XPathNodeIterator iterator = navigator.Select(expression);

        HtmlTable table = new HtmlTable();
        HtmlTableRow row = new HtmlTableRow();
        HtmlTableCell cell = new HtmlTableCell();
        string tooltip = "";
        try
        {
            while (iterator.MoveNext())
            {
                tooltip = "";
                row = new HtmlTableRow();
                cell = new HtmlTableCell();

                XPathNavigator navigator2 = iterator.Current.Clone();
                Label label = new Label();
                label.ID = navigator2.Name + "Label";
                label.Text = navigator2.GetAttribute("name", navigator2.NamespaceURI);
                tooltip = navigator2.GetAttribute("description", navigator2.NamespaceURI);

                Control c = null;

                if (label.ID != "")
                {
                    c = new TextBox();
                    c.ID = navigator2.GetAttribute("name", navigator2.NamespaceURI) + "Textbox";
                    (c as TextBox).Text = navigator2.Value;
                    (c as TextBox).ToolTip = tooltip;
                    (c as TextBox).Width = 700;
                    (c as TextBox).TextMode = TextBoxMode.MultiLine;
                    label.ToolTip = tooltip;
                }

                cell.Controls.Add(label);
                row.Cells.Add(cell);

                cell = new HtmlTableCell();
                cell.Controls.Add(c);
                row.Cells.Add(cell);
                controls.Add(new ControlListItem(navigator2.Name, c.ID));

                table.Rows.Add(row);
            }
        }
        catch (Exception ex)
        {
            FormMessage.ForeColor = Color.Red;
            FormMessage.Text = ex.Message;
        }

        ControlsPanel.Controls.Add(table);

        base.OnInit(e);
    }
开发者ID:TCarmack,项目名称:Brentwood,代码行数:60,代码来源:SiteSettings.aspx.cs

示例11: AddRow

 private static HtmlTableRow AddRow(JobControl_Get_Result controlResult)
 {
     HtmlTableRow row = new HtmlTableRow();
     row.Cells.Add(AddLabel(controlResult.ControlName));
     row.Cells.Add(AddControl(controlResult));
     return row;
 }
开发者ID:TCarmack,项目名称:Brentwood,代码行数:7,代码来源:WebUtils.cs

示例12: Render

	protected override void Render (HtmlTextWriter writer)
	{
		HtmlTableRow row = new HtmlTableRow ();
		HtmlTableCell cell = new HtmlTableCell ();
		cell.InnerHtml = "Test cell is visible";
		row.Cells.Add (cell);
		Table1.Rows.Add (row);
		Table1.Visible = true;
		Table1.RenderControl (writer);
	}
开发者ID:mono,项目名称:gert,代码行数:10,代码来源:Default.aspx.cs

示例13: Page_Load

    protected void Page_Load (object sender, EventArgs e)
    {
        GeographyBallotCoverageLookup lookup = GetLookupFromCache();

        HtmlTableRow tr = null;
        HtmlTableCell td = null;
        tr = new HtmlTableRow(); mainTable.Rows.Add(tr);
        td = CreateCell(tr, "Geography");

        td = CreateCell(tr, "GeographyId");
        td = CreateCell(tr, "VoterCount");
        td = CreateCell(tr, "AdvanceVotingStationsDistro");
        td = CreateCell(tr, "AdvanceVotingStationsTotal");
        td = CreateCell(tr, "VotingStationsTotal");
        td = CreateCell(tr, "VotingStationsDistroSingle");
        td = CreateCell(tr, "VotingStationsDistroDouble");
        td = CreateCell(tr, "VotingStationsComplete");
        td = CreateCell(tr, "WAdvanceVotingStationsDistro");
        td = CreateCell(tr, "WAdvanceVotingStationsTotal");
        td = CreateCell(tr, "WWAdvanceVotingStationsDistro");
        td = CreateCell(tr, "WWAdvanceVotingStationsTotal");
        td = CreateCell(tr, "WVotingStationsTotal");
        td = CreateCell(tr, "WVotingStationsDistroSingle");
        td = CreateCell(tr, "WVotingStationsDistroDouble");
        td = CreateCell(tr, "WVotingStationsComplete");
        
        foreach (int geoId in lookup.Keys)
        {
            tr = new HtmlTableRow(); mainTable.Rows.Add(tr);
            GeographyBallotCoverageDataPoint pt = lookup[geoId];

            td = CreateCell(tr, "" + Geography.FromIdentity((pt.GeographyId)).Name);

            td = CreateCell(tr, "" + pt.GeographyId);
            td = CreateCell(tr, "" + pt.VoterCount);
            td = CreateCell(tr, "" + pt.AdvanceVotingStationsDistro);
            td = CreateCell(tr, "" + pt.AdvanceVotingStationsTotal);
            td = CreateCell(tr, "" + pt.VotingStationsTotal);
            td = CreateCell(tr, "" + pt.VotingStationsDistroSingle);
            td = CreateCell(tr, "" + pt.VotingStationsDistroDouble);
            td = CreateCell(tr, "" + pt.VotingStationsComplete);
            td = CreateCell(tr, "" + pt.WAdvanceVotingStationsDistro);
            td = CreateCell(tr, "" + pt.WAdvanceVotingStationsTotal);
            td = CreateCell(tr, "" + pt.WWAdvanceVotingStationsDistro);
            td = CreateCell(tr, "" + pt.WWAdvanceVotingStationsTotal  );
            td = CreateCell(tr, "" + pt.WVotingStationsTotal);
            td = CreateCell(tr, "" + pt.WVotingStationsDistroSingle);
            td = CreateCell(tr, "" + pt.WVotingStationsDistroDouble);
            td = CreateCell(tr, "" + pt.WVotingStationsComplete);

        }


    }
开发者ID:SwarmCorp,项目名称:Swarmops,代码行数:54,代码来源:BallotsData.aspx.cs

示例14: CreateAssetRow

    private HtmlTableRow CreateAssetRow(JobAsset item, HttpServerUtility server)
    {
        HtmlTableRow row = new HtmlTableRow();
        string filename = Path.GetFileName(item.Filepath);
        row.Cells.Add(CreateCell("Job Asset: " + filename));
        HtmlTableCell cell = new HtmlTableCell();
        cell = new HtmlTableCell();
        string url = WebUtils.ResolveVirtualPath(item.Filepath).Replace("~", "..");
        cell.InnerHtml = String.Format("<a href=\"{0}\" target=\"blank\">{1}</a>", url, "Open File");
        row.Cells.Add(cell);

        return row;
    }
开发者ID:TCarmack,项目名称:Brentwood,代码行数:13,代码来源:OrderPage.aspx.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if ( !IsPostBack ) {
            IDataReader reader = (IDataReader)dsRegister.Select(new DataSourceSelectArguments());
            try
            {
                while (reader.Read())
                {
                    HtmlTableRow row = new HtmlTableRow();
                    HtmlTableCell cell = new HtmlTableCell();
                    cell.InnerText = reader["DepName"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);

                    cell = new HtmlTableCell();
                    cell.InnerText = reader["ToolName"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);

                    cell = new HtmlTableCell();
                    cell.InnerText = reader["PersName"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);

                    cell = new HtmlTableCell();
                    cell.InnerText = reader["ManufName"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);

                    cell = new HtmlTableCell();
                    cell.InnerText = reader["CouName"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);

                    cell = new HtmlTableCell();
                    cell.InnerText = reader["MarkName"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);

                    cell = new HtmlTableCell();
                    cell.InnerText = reader["Count_l"].ToString();
                    row.Cells.Add(cell);
                    TableViewRegister.Rows.Add(row);
                }
            }
            finally
            {
                reader.Close();
            }
        }
    }
开发者ID:FreeCX,项目名称:study,代码行数:51,代码来源:lab03_table_00.aspx.cs


注:本文中的HtmlTableRow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。