Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:08:08+00:00 2026-05-23T08:08:08+00:00

I have an HTML table in which one particular cell can have long text

  • 0

I have an HTML table in which one particular cell can have long text (up to a paragraph). Is there a way to change the way text wraps in that cell so that if it is long enough to stretch the table horizontally it instead wraps and possibly stretches the table vertically? I want the width of the column to be determined dynamically by the rest of the cells in the column as it would be if there was no text in that cell.

Clarification: I want the width of the cell with potentially long text to be determined entirely by the widths of the other cells in the columns, with the text in it wrapped to fit within that width. I do not want to have a static column width or max column width because the page is generated dynamically with data from a database.

Example:

<table>
    <tr><td>Test Test Test</td></tr>
    <tr><td class="X">Test Test Test Test Test Test Test Test Test</td>
</table>

Where "X" denotes the cell that should wrap when possible

The default behavior is

|--------------------------------------------|
|Test Test Test Test                         |
|--------------------------------------------|
|Test Test Test Test Test Test Test Test Test|
|--------------------------------------------|

I want it to instead do

|-------------------|
|Test Test Test Test|
|-------------------|
|Test Test Test Test|
|Test Test Test Test|
|Test               |
|-------------------|

Even if this is smaller than the width of the screen. I am wondering if it is possible to do this without knowing the width of any of the text when I create the table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:08:09+00:00Added an answer on May 23, 2026 at 8:08 am

    I solved this by setting the width to one pixel in the table cell I wanted to have forced word wrap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html structure (which is generated and I can't change): <table
I have large URL(without spaces) in one of my Table(html table element) cell which
I have a table which has one row and only one cell will be
I have a static Html Table which contains one button Add and when clicking
I have a HTML Table which is similar to the one shown (demo.jpg) in
I have a problem when converting a static html table to one which is
I have an html table which i bind data dynamically on the server side
I have a html table in which each line ( <tr> ) represents a
I have a repeater control outputting some HTML. I want a table which outputs
I have an HTML table having n rows and each rows contain one radiobutton

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.