473,785 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make a cell in a table word-wrap

57 New Member
1. My boss wants me to make the text in my table cells 'wrap' which means become multiline if the string is longer than the cell width.

Here is how I make the elements with this data, where 'data_value' is the string that
will show up in the table:

var tdElem = document.create Element("td");
tdElem.classNam e = className;
txtNode = document.create TextNode(data_v alue);
tdElem.appendCh ild(txtNode);
tdElem.id=Id;

then later on this tdElem thing gets appended to my row:
trElem.appendCh ild(tdElem);

2. Well maybe this needs to be a separate question. But once my table gets over a few thousand rows my resize and sort are slow as molasses. I am desiring to replace an existing infragistics grid which can handle this many rows without wigging out. I bascially just found table sort and resize examples on the web and imitated them. My question is , in general, am I going to be successful in javascript client side only logic and what kind of design do I need to do it? I am using quick sort, and changing the widths of all my elements for the resize. Is there some means of creating html using the infragistics and adding it somehow to my table's innerhtml?
Jan 22 '08 #1
2 4796
Ranjan kumar Barik
95 New Member
1. My boss wants me to make the text in my table cells 'wrap' which means become multiline if the string is longer than the cell width.

Here is how I make the elements with this data, where 'data_value' is the string that
will show up in the table:

var tdElem = document.create Element("td");
tdElem.classNam e = className;
txtNode = document.create TextNode(data_v alue);
tdElem.appendCh ild(txtNode);
tdElem.id=Id;

then later on this tdElem thing gets appended to my row:
trElem.appendCh ild(tdElem);

2. Well maybe this needs to be a separate question. But once my table gets over a few thousand rows my resize and sort are slow as molasses. I am desiring to replace an existing infragistics grid which can handle this many rows without wigging out. I bascially just found table sort and resize examples on the web and imitated them. My question is , in general, am I going to be successful in javascript client side only logic and what kind of design do I need to do it? I am using quick sort, and changing the widths of all my elements for the resize. Is there some means of creating html using the infragistics and adding it somehow to my table's innerhtml?
Hi,
You are assigning a class to the cell, then just add
Expand|Select|Wrap|Line Numbers
  1. word-break:break-all;
  2.  
to your class declaration. I hope it will work.

Happy programming!
:)
Jan 23 '08 #2
jhaxo
57 New Member
Hi,
You are assigning a class to the cell, then just add
Expand|Select|Wrap|Line Numbers
  1. word-break:break-all;
  2.  
to your class declaration. I hope it will work.

Happy programming!
:)
Thanks, It is working. I had to also have table-layout:fixed;, which I found after googling with your word-break:break-all

My ide, visual studio 2005, does not think word-break is a valid css element but its working.

Do you have any idea about question 2
Jan 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1853
by: Joe Conlin | last post by:
I am truncating data from an SQL database and have a script that populates a cell. The problem that I have is I have HTML tags in my database so if the data gets truncated in the middle of a tag, then my page goes...well, you know. What I am looking for is a way that I can contain ANY data (i.e. characters, tags, etc.) directly in that cell. So...If I have a <table> tag it will not throw off the rest of the table tags throughout my page. ...
82
10723
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | | | | | | | | left | center | right | | | | | | | | |
6
1791
by: tshad | last post by:
I have a cell with 2 items in it: a textbox and a link. The link is actually a button (image), but for the example I am using a link, which is doing the same thing. Here is the stripped down version of my page that shows the problem: *********************************************************************************** <html> <head></head>
4
10785
by: HB | last post by:
So I have a table in ASP.NET <table runat="server" id="tblMyTable"> <tr> <td id="cellMyCell">word</td> </tr> </table> How do I reference the cell "cellMyCell" from the Vb.NET 1.1 code-behind to change the background color of the cell?
7
2453
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is rendered as a page (or actualy a part of a page) that is editiable. To do this I let the user download the document, edit it and then upload it back to the site. Then at Page_Open, I convert the .doc file to an html and render it back to the page......
8
2677
by: active | last post by:
I have a table on my page with rows and cells. I try to drag a table from the toolbox into one of the cells but the drag symbol shows it is not allowed (and the table does not drop) Can I inset a table into a cell? If so how. My problem does not really relate only to the table since I can't drag any
0
1558
by: pmeems | last post by:
This is my first post to this group. So I say hello to all members. I'm in the process of converting my C# early binding of MS Word to late binding so I don't have any trouble running my application on a different pc (using a different version of MS Word). I'm still struggling with converting these lines of code: Object oUnit = Word.WdUnits.wdCell; _WordDoc.ActiveWindow.Selection.MoveRight(ref oUnit, ref _missing, ref _missing);
7
6172
by: buntyindia | last post by:
I have the following scrollable table I have to implemet a functionality that I can select a row in it & display that data in popup window.. Any hints/example or similar available implementation? http://img120.imageshack.us/img120/8209/tableyv4.gif http://www.imaputz.com/cssStuff/bigFourVersion.html# Help
4
4650
by: karen987 | last post by:
I have a column in a table, which draws out info from a database. The column is 150px wide. I want it to remain this wide, even if one word is longer. What happens now is that if i put in a web address which is long, it makes the columner wider. I want to make it trunucate the url so that it ends after 150px has been reached and continues to the next line. If i have a word longer than 460px i will have the same problem. Any solutions anyone?...
2
3819
by: Jukka K. Korpela | last post by:
Sub titulo "Re: DIV borders different in IE7 when in td" scripsit Ben C: This seems to be the heart of the matter, and I'm trying to get a real discussion started, by moving the discussion to the right group (c.i.w.a.stylesheets) and changing the Subject line. It seems to me that IE 7, specifically in "standards mode" (!), misbehaves when a table cell has a declared width but the actual width
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9485
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.