Sütun genişliğini em veya yüzde gibi ölçeklenebilir birime ayarlayın
Contents
[
Hide
]
Bir elektronik tablodan HTML dosyası oluşturmak çok yaygındır. Sütunların boyutu, birçok durumda işe yarayan “pt” ile tanımlanır. Ancak, bu sabit boyutun gerekli olmayabileceği bir durum olabilir. Örneğin, bu HTML sayfasının görüntülendiği yerde bir konteyner paneli genişliği 600px ise. Bu durumda, oluşturulan tablo genişliği daha büyükse yatay bir kaydırma çubuğu elde edebilirsiniz. Daha iyi bir sunum elde etmek için bu sabit boyutun em veya yüzde gibi ölçeklenebilir bir birime dönüştürülmesi istenmiştir. Aşağıdaki örnek kod nerede kullanılabilir?HtmlSaveOptions.WidthScalable ayarlandıdoğru ölçeklenebilir genişlik oluşturmak için.
Örnek kaynak dosya ve çıktı dosyaları aşağıdaki bağlantılardan indirilebilir:
outsampleForScalableColumns.zip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Load sample source file | |
Workbook wb = new Workbook(sourceDir + "sampleForScalableColumns.xlsx"); | |
// Specify Html Save Options | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Set the property for scalable width | |
options.WidthScalable = true; | |
// Specify image save format | |
options.ExportImagesAsBase64 = true; | |
// Save the workbook in Html format with specified Html Save Options | |
wb.Save(outputDir + "outsampleForScalableColumns.html", options); |