Skip to main content

Command Palette

Search for a command to run...

CSS : how to wrap content in the td for a table

Published
1 min read
S

I love learning about technology and sharing that with others

📑 how to wrap content in the td for a table

  • 🏷️Tags : #17-05-2022, #pending #completed #permanent

stackoverflow

Problem

  1. content in the table , is much so because of that the table is becoming wide and there is a scrollbar at the bottom

Solution

  1. we have to wrap the content of the td


 td {

    /* css-3 */
    white-space: -o-pre-wrap; 
    word-wrap: break-word;       /* only this one change works for me  */
    white-space: pre-wrap; 
    white-space: -moz-pre-wrap; 
    white-space: -pre-wrap; 

}
  1. modify the table layout
table { 
  table-layout: fixed;
  width: 100%
}
2 views

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)