小编ope*_*tza的帖子

仅使用一列生成表

您好我尝试生成一个只有一列的表.所以我的链接只显示在一列中.

这是我的功能:

    function createTableForPdfFiles() {

        //To Create The Table
        var table = document.createElement("table");
        table.setAttribute('id', 'pdfTable');
        table.setAttribute('class', 'AANTable');

        // insert Title Row
        var TitleRow = table.insertRow();
        var cell = TitleRow.insertCell(); 
        cell.setAttribute('class', 'AANTitleRow');
        cell.setAttribute('colSpan', pdfFiles.length + 1);
        cell.appendChild(document.createTextNode("Datenblätter"));

        //Insert Table Rows
        var pdfRow = table.insertRow();
        var cell = pdfRow.insertCell(); //Where the PDF´s are displayed
        cell.setAttribute('class', 'AANPdfRow');

        for (var i = 0; i < pdfFiles.length; i++) {
            var cell = pdfRow.insertCell();
            var link = document.createElement("a");
            link.setAttribute("href", "www.test.at" + pdfFiles[i].Link);
            var linktext = document.createTextNode(pdfFiles[i].Link); …
Run Code Online (Sandbox Code Playgroud)

html javascript

3
推荐指数
1
解决办法
62
查看次数

如何制作字符串Bold的一部分并将其添加到excel Cell?

您好我尝试将字符串的一部分加粗,然后将其添加到excel Cell.所以它看起来像:

Excel Cell

我尝试了什么:

在Excel中使用范围:

excelSheet.get_Range("A" + 16, "D" + 16).Font.Bold = true;
Run Code Online (Sandbox Code Playgroud)

但这使一切都变得大胆......

然后我试过:

"<b>" + text + "<b>"
Run Code Online (Sandbox Code Playgroud)

并没有成功.

所以我做错了.任何帮助或建议都会很棒,谢谢你的时间.

编辑:工作C#代码:

Excel.Range range1 = excelSheet.Range["A36"];
Excel.Characters test = range1.get_Characters(21, 4);
test.Font.Bold = true;
Run Code Online (Sandbox Code Playgroud)

c# excel office-interop

2
推荐指数
1
解决办法
3566
查看次数

为什么最后一行永远不会被读取?

您好我有一个问题为什么最后一行永远不会被读取?如果excel文件中只有一行或100行,则无关紧要.最后一行永远不会出现在列表中.我不知道为什么......

这是我的Excel文件: Excel文件

这是我的方法:

public List<string> getListData(bool skipFirstRow, int numberOfColumns, string filepath)
{
    int startpoint = 1;
    int cell = 1;
    int row = 1;

    List<string> stringList = new List<string>();

    //Open Excel (Application)
    var excelApplication = openExcelApplication();
    //Open Excel File
    Excel.Workbook excelWorkbook = excelApplication.Workbooks.Open(filepath);
    //Get the Worksheets from the file
    Excel.Sheets excelSheets = excelWorkbook.Worksheets;
    //Select the first Worksheet
    Excel.Worksheet worksheet = (Excel.Worksheet)excelSheets.get_Item(1);

    if (skipFirstRow == true)
    {
        startpoint = 2;
    }

    Excel.Range range = worksheet.get_Range("A" + Convert.ToString(startpoint), Missing.Value);

    while ((range.Cells[startpoint, cell] …
Run Code Online (Sandbox Code Playgroud)

c# excel excel-interop

2
推荐指数
1
解决办法
267
查看次数

标签 统计

c# ×2

excel ×2

excel-interop ×1

html ×1

javascript ×1

office-interop ×1