473,498 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set word wrap in asp:table

92 New Member
I want to know to set word wrap in asp table. I tried with cells.wrap=true, but no effect.
May 31 '10 #1
4 4237
Frinavale
9,735 Recognized Expert Moderator Expert
This should be done already for you. An ASP.NET GridView is rendered as an HTML table element.

I just tested the HTML table element and discovered that it automatically does "word wrapping" based on the cell width.

See for yourself by copying this into a text file and giving it an .html extension:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.   <style type="text/css">
  5.     td{
  6.       width:50px;
  7.       border:solid 1px black;
  8.     }
  9.     table{
  10.       border:solid 1px black;
  11.     }
  12.   </style>
  13. </head>
  14. <body>
  15.   <table id="myTable">
  16.     <tr>
  17.       <td>
  18.         This is some text. This is some text. This is some text.
  19.       </td>
  20.       <td>
  21.         This is some text. This is some text. This is some text.
  22.       </td>
  23.     </tr>
  24.     <tr>
  25.       <td>
  26.         This is some text. This is some text. This is some text.
  27.       </td>
  28.       <td>
  29.         This is some text. This is some text. This is some text.
  30.       </td>
  31.     </tr>
  32.     <tr>
  33.       <td>
  34.         This is some text. This is some text. This is some text.
  35.       </td>
  36.       <td>
  37.         This is some text. This is some text. This is some text.
  38.       </td>
  39.     </tr>
  40.   </table>
  41. </body>
  42. </html>
Now, you could try to use CSS to set the overflow style for the cells (<td> elements) but when I tried this I didn't have any luck. I think that the overflow style only applies to block elements (and table cell elements are not block elements).

-Frinny
May 31 '10 #2
visweswaran2830
92 New Member
Hi, I want to set word wrap in gridview. I tried with div tag, I creates horizontal
Jun 7 '10 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Did you set a width for the GridView?
Did you set a width for the columns?

If not, try removing the div tags and setting these properties.

-Frinny
Jun 7 '10 #4
visweswaran2830
92 New Member
ya, I set width as you have mentioned, But i cannot get the solution. Any other possible way.
Jun 8 '10 #5

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

Similar topics

0
464
by: Stephen | last post by:
I have been getting on well with help from this forum trying to create an array list and work with it. Everything is working fine apart from displaying my array list items into the labels in my...
3
11992
by: Marty McDonald | last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate a DataTable whose data should appear in the asp:Table. I created my own code to populate the asp:Table with the...
4
3917
by: Nathan Sokalski | last post by:
When editing an ASP Table, Visual Studio does not allow me to edit it in Design View. This makes it harder to add elements, because I must add every element either by using Design View to create...
2
1264
by: Sue | last post by:
Is there a way to add comments on the HTML page within an ASP:Table? (ever try and use "comments" as a search word <g>?) tia, Sue
2
3319
by: etienne.bourgeois | last post by:
Hi Everybody, I'm a bit of a newb at .NET, so here is my problem... I fill up a drop down list with values from a SQL database, everything is fine and it shows up in my drop down list, however...
10
72643
by: Lorenzo Thurman | last post by:
I have a table cell that I want to wrap text inside of. I've tried both hard and soft wrap, but Firefox refuses to obey. IE 6&7 handle the wrap just fine. Does anyone know how I can fix this?
5
6724
by: momo | last post by:
say i have the following table: <table width="500"> <tr> <td width="250">this is the text im concerned with</td> <td></td> </tr> </table> i need the width of the columns to STAY at 250 and...
10
9773
by: Greg Lovern | last post by:
I have a very large html table created by MS Word, saved as it's "Web Page, Filtered" file type. Every html table cell has lots of formatting tags. Most of the file size is that formatting. Is...
1
4988
by: vedika | last post by:
Hello, I have problem with word-wrapping. When width is given in pixel style="word-wrap:word-break" works well but when it is given in percentage then it is not working. <table border="1"...
3
2689
by: visweswaran2830 | last post by:
I have html table.I am creating table rows & cells at run time using aspx.vb. Now I want to set word wrap in html table cell. How do I set this?
0
7126
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,...
0
7005
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...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5465
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,...
0
4595
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...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
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 ...
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.