Enum HtmlCrossType

HtmlCrossType enumeration

Represents five types of html cross string.

public enum HtmlCrossType

Values

NameValueDescription
Default0Display like MS Excel,depends on the next cell. If the next cell is null,the string will cross,or it will be truncated
MSExport1Display the string like MS Excel exporting html.
Cross2Display HTML cross string, this performance for creating large html files will be more than ten times faster than setting the value to Default or FitToCell.
CrossHideRight3Display HTML cross string and hide the right string when the texts overlap.
FitToCell4Only displaying the string within the width of cell.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellsClassHtmlCrossTypeDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            
            // Access first worksheet
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Add sample data
            worksheet.Cells["A1"].PutValue("Sample");
            worksheet.Cells["B1"].PutValue("Data");
            worksheet.Cells["A2"].PutValue(123);
            worksheet.Cells["B2"].PutValue(456);
            
            // Create HTML save options
            HtmlSaveOptions options = new HtmlSaveOptions();
            
            // Set cross type to MSExport
            options.HtmlCrossStringType = HtmlCrossType.MSExport;
            
            // Save workbook with HTML options
            workbook.Save("output.html", options);
            
            Console.WriteLine("HTML file saved with HtmlCrossType.MSExport");
        }
    }
}

See Also