HtmlTableLoadOptionCollection.Item

HtmlTableLoadOptionCollection indexer

Gets the HtmlTableLoadOption element at the specified index.

public HtmlTableLoadOption this[int index] { get; }
ParameterDescription
indexThe zero based index of the element.

Return Value

The element at the specified index.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class HtmlTableLoadOptionCollectionPropertyItemDemo
    {
        public static void Run()
        {
            // Create HtmlLoadOptions
            HtmlLoadOptions loadOptions = new HtmlLoadOptions();
            HtmlTableLoadOptionCollection tableLoadOptions = loadOptions.TableLoadOptions;

            // Add a new HtmlTableLoadOption by table index
            int index1 = tableLoadOptions.Add(0);

            // Access the HtmlTableLoadOption using Item property
            HtmlTableLoadOption option = tableLoadOptions[index1];

            // Configure the table load option
            option.TableToListObject = true;
            option.TargetSheetIndex = 1;

            // Load HTML file with the configured options
            Workbook workbook = new Workbook("input.html", loadOptions);

            // Save the workbook
            workbook.Save("output.xlsx");
        }
    }
}

See Also