Datatable to html Table

前端 未结 8 2044
感动是毒
感动是毒 2020-11-27 14:42

I have question, that maybe someone here wouldn\'t mind to help me with. I have lets say 3 datatables, each one of them has the following columns:

size, quantity, amo

8条回答
  •  借酒劲吻你
    2020-11-27 15:45

    use this function:

        public static string ConvertDataTableToHTML(DataTable dt)
        {
            string html = "";
            //add header row
            html += "";
            for(int i=0;i";
            html += "";
            //add rows
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                html += "";
                for (int j = 0; j< dt.Columns.Count; j++)
                    html += "";
                html += "";
            }
            html += "
    " + dt.Rows[i][j].ToString() + "
    "; return html; }

提交回复
热议问题