Table column missing in SharePoint modern page

Kannan Subramaniyam 1 Reputation point
2021-08-10T03:10:49.34+00:00

Hi,

I creating a modern page with a table from an exported HTML file using AddClientSidePage and ClientSideText. The page is created with content in HTML file but the table is not showing with all the columns. Also, there is no horizontal scroll bar to move right. When I edit the page, I can able to move those missing columns by moving the cursor to the right side using the right arrow.

Note: The table contains few images and those images are uploaded on the SharePoint site.

Here is the C# code to create the page with the Html content.

var page = clientContext.Web.AddClientSidePage(pageName + ".aspx", true);
page.AddSection(CanvasSectionTemplate.OneColumn, 0);
page.Save();

CanvasSection section = page.Sections[0];

ClientSideText pageConent = new ClientSideText() { Text = htmlContent };

page.AddControl(pageConent, section.Columns[0], 0);
page.Save();
page.Publish();

Thanks,
Kannan

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2021-08-10T09:15:56.163+00:00

    Hi @Kannan Subramaniyam ,
    Per my test,I found we are unable to create table by ClientSideText. <table> tag can't work in ClientSideText().


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.